Skip to content

Instantly share code, notes, and snippets.

@jacoor
Created September 17, 2018 16:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacoor/cc9c7adcc0328d235971a653a60be3bd to your computer and use it in GitHub Desktop.
Save jacoor/cc9c7adcc0328d235971a653a60be3bd to your computer and use it in GitHub Desktop.
skipping header in AWS glue
# use filter, Luke
# the idea is to use a filter function that will return True for the records to keep.
# Usage: just use before the last function at end of your ETL job script. Update frame and update next function frame with "filtered".
def filter_function(dynamicRecord):
if dynamicRecord.merchant_id == "merchant_id" and dynamicRecord.merchant_ref_number == "merchant_ref_number":
return False
else:
return True
filtered = Filter.apply(frame = dropnullfields3, f = filter_function, transformation_ctx = "filtered")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment