Skip to content

Instantly share code, notes, and snippets.

@shawnhermans
Created November 27, 2013 23:08
Show Gist options
  • Save shawnhermans/7684660 to your computer and use it in GitHub Desktop.
Save shawnhermans/7684660 to your computer and use it in GitHub Desktop.
Simple example of converting tuples to a map
@outputSchema("output:map[]")
def tupleToMap(inputs):
field_names = ["field1", "field2", "field3"]
result = {}
if len(field_names) == len(inputs):
for i in range(len(inputs)):
result[field_names[i]] = inputs[i]
return result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment