Last active
June 9, 2021 15:44
-
-
Save hang15/db2f87d929a49a864d3d5001a38f17c3 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
new_offset = offset + bodylines.offset | |
if new_offset < s3_object.content_length: | |
new_event = { | |
**event, | |
"offset": new_offset, | |
"fieldnames": fieldnames | |
} | |
invoke_lambda(context.function_name, new_event) | |
def invoke_lambda(function_name, event): | |
payload = json.dumps(event).encode('utf-8') | |
client = boto3.client('lambda') | |
response = client.invoke( | |
FunctionName=function_name, | |
InvocationType='Event', | |
ClientContext='string', | |
Payload=payload | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment