-
Notifications
You must be signed in to change notification settings - Fork 429
Docs: Improve guidance to developers on reflecting record failures #2848
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
Comments
Thank you so much for taking the time to report on Discord and create a beautifully detailed issue @94Sip - we'll ping once we have a draft for review. Thanks! |
PR is now up with all changes: #2857 |
Closing manually as automation seems to have failed upon release: https://docs.powertools.aws.dev/lambda/python/latest/utilities/batch/#error-handling |
|
This is now released under 2.23.0 version! |
What were you searching in the docs?
I was specifically looking for guidance in the docs on what the record_handler function should return to reflect a record (batch item) could not be handled successfully.
Is this related to an existing documentation section?
https://docs.powertools.aws.dev/lambda/python/latest/utilities/batch/#partial-failure-mechanics
How can we improve?
My recommendation is to specifically state that developers should raise an Exception (in python, for example) for any record that could not be processed successfully, and explicitly state the the "partial_process_response" object will handle any exceptions thrown by the record handler.
By looking at the "sample response" section, it implies that the "batchItemFailures" dictionary is returned, but it doesn't explicitly state how that response gets generated and what is required of the developer.
Got a suggestion in mind?
Responsibility of the developer/engineer implementing the record_handler method:
Either way, an Exception is used to notify the partial_process_response object that record handling was not successful.
From that point forward, the partial_process_response object will take care of formatting the "batchItemFailures" dictionary back to SQS.
Acknowledgment
The text was updated successfully, but these errors were encountered: