Skip to content

fix(batch): resolve KeyError when building SQS partial batch failures without messageId#8274

Open
KirtiRamchandani wants to merge 1 commit into
aws-powertools:developfrom
KirtiRamchandani:fix/sqs-missing-message-id-partial-response
Open

fix(batch): resolve KeyError when building SQS partial batch failures without messageId#8274
KirtiRamchandani wants to merge 1 commit into
aws-powertools:developfrom
KirtiRamchandani:fix/sqs-missing-message-id-partial-response

Conversation

@KirtiRamchandani

@KirtiRamchandani KirtiRamchandani commented Jun 14, 2026

Copy link
Copy Markdown

Issue number: closes #8273

Summary

Changes

Malformed SQS records missing messageId crashed BatchProcessor.response() with KeyError when building partial batch failures. Read the identifier from the underlying event dict instead of strict property access.

User experience

Lambdas using partial batch responses no longer fail entirely when a handler throws on a malformed record.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Read messageId from the underlying event dict when handler failures
occur on malformed SQS records missing that field.
@KirtiRamchandani KirtiRamchandani requested a review from a team as a code owner June 14, 2026 04:07
@boring-cyborg

boring-cyborg Bot commented Jun 14, 2026

Copy link
Copy Markdown

Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need.
In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link

@boring-cyborg boring-cyborg Bot added the tests label Jun 14, 2026
@powertools-for-aws-oss-automation powertools-for-aws-oss-automation Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 14, 2026
@sonarqubecloud

Copy link
Copy Markdown

@KirtiRamchandani KirtiRamchandani changed the title Fix KeyError when building SQS partial batch failures without messageId fix(batch): resolve KeyError when building SQS partial batch failures without messageId Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BatchProcessor.response() crashes with KeyError when failed SQS record lacks messageId

1 participant