This 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",
{}
)
[1] https://docs.aws.amazon.com/appsync/latest/devguide/resolver-mapping-template-reference-lambda.html#request-mapping-template
This line got introduced in v0.18.0 that assumes that the
eventobject will always be adict, but there are cases where the lambdaeventobject can be aList[dict].BatchInvokeevents 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 withBatchInvoke, the lambda function fails right away (and without a sentry error, which is understandable...but made finding this a real pain)[1] https://docs.aws.amazon.com/appsync/latest/devguide/resolver-mapping-template-reference-lambda.html#request-mapping-template