Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(awslambda): aws_event can be an empty list #2849

Merged
merged 3 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion sentry_sdk/integrations/aws_lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def sentry_handler(aws_event, aws_context, *args, **kwargs):
# will be the same for all events in the list, since they're all hitting
# the lambda in the same request.)

if isinstance(aws_event, list):
if isinstance(aws_event, list) and len(aws_event) >= 1:
request_data = aws_event[0]
batch_size = len(aws_event)
else:
Expand Down
1 change: 1 addition & 0 deletions tests/integrations/aws_lambda/test_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ def test_handler(event, context):
True,
2,
),
(b"[]", False, 1),
],
)
def test_non_dict_event(
Expand Down