Skip to content

Instantly share code, notes, and snippets.

@hang15
Last active June 9, 2021 15:44
Show Gist options
  • Save hang15/db2f87d929a49a864d3d5001a38f17c3 to your computer and use it in GitHub Desktop.
Save hang15/db2f87d929a49a864d3d5001a38f17c3 to your computer and use it in GitHub Desktop.
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