v0.18.0+ regression with batched lambda events
See original GitHub issueThis line got introduced in v0.18.0 that assumes that the event
object will always be a dict
, but there are cases where the lambda event
object can be a List[dict]
.
BatchInvoke
events with AppSync [1] are the ones that I’m running up against right now after trying to upgrade the sdk. Anytime I invoke the lambda with a resolver configured with BatchInvoke
, the lambda function fails right away (and without a sentry error, which is understandable…but made finding this a real pain)
[ERROR] AttributeError: 'list' object has no attribute 'get'
Traceback (most recent call last):
File "/var/task/sentry_sdk/integrations/aws_lambda.py", line 106, in sentry_handler
headers = event.get("headers",
{}
)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Unable to add an SQS event source to a Lambda function with ...
I'm unable to connect Lambda function to an SQS event source. ... It seems that this might be a regression bug introduced in...
Read more >AWS Lambda now supports partial batch response for SQS as ...
AWS Lambda now supports partial batch response for SQS as an event source. With this feature, when messages on an SQS queue fail...
Read more >LambdaSharp "Hicetas" Release (v0.8.3.4) - 2021-07-15
The ALambdaFunction base class has new methods for sending events, capturing metrics, and logging debug statements. In addition, the LambdaSharp.
Read more >@aws-cdk/aws-lambda-event-sources - Package Manager
An event source mapping is an AWS Lambda resource that reads from an event source and invokes a Lambda function. You can use...
Read more >Batch Processing - AWS Lambda Powertools for Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We are working on a fix.
Great, thanks!
And yup - have seen that page, but wasn’t sure if multiple entries inside of
event
meant there might be multiplecontext
objects. But the two “contexts” being unrelated makes more sense now, as the one in your mapping template calls upon properties not listed on that spec page for the passedcontext
object. Them being independent also explains how in your mapping template, there seemed to be one$context
per record, whereas you’ve just confirmed that there’s only one passedcontext
object per batch request.About to push a fix.