Skip to content

Instantly share code, notes, and snippets.

@brunoripa
Created January 30, 2018 15:12
Show Gist options
  • Save brunoripa/b621882385eb179fbfb5db3096dc5531 to your computer and use it in GitHub Desktop.
Save brunoripa/b621882385eb179fbfb5db3096dc5531 to your computer and use it in GitHub Desktop.
class CollectTimings(apache_beam.DoFn):
def process(self, element):
"""
Returns a list of tuples containing country and duration
"""
result = [
(element['country'], element['duration'])
]
return result
class CollectUsers(apache_beam.DoFn):
def process(self, element):
"""
Returns a list of tuples containing country and user name
"""
result = [
(element['country'], element['user'])
]
return result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment