Created
January 30, 2018 15:12
-
-
Save brunoripa/b621882385eb179fbfb5db3096dc5531 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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