-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
delete_item ReturnValuesOnConditionCheckFailure does not return Attributes upon failure. #3925
Comments
Hi @kvr000 thanks for reaching out. In the issue you linked, someone commented saying that the issue was due to an older Lambda runtime: aws/aws-sdk-js-v3#5045 (comment). Here are the default runtimes along with the SDK version they come with. These get updated periodically by the Lambda team. If you the boto3/botocore version you're using in Lambda is missing functionality, then you can try adding a Lambda layer or runtime dependency with a more recent version — this documentation and article provide the steps for doing that. Here are the boto3 and botocore CHANGELOGs if you're looking for particular changes in a specific version. The issue here may be that you're using the delete_item resource command rather than the client command. There is a feature freeze on boto3 resources, and you may see some functionality supported in client commands that isn't available for resources. I hope that helps — please let us know if you have any follow up questions. And if you want to provide debug logs (with any sensitive info redacted) by adding |
Thanks @tim-finnigan for the response and suggesting how to enable the log. It helped and I found the issue. The code was checking I think it's worth updating the documentation as it never mentions the I also update the request to making working with current response. |
Thanks @kvr000 for following up and for your patience here. That page you referenced does list the following for Do you have specific feedback on how the wording could be improved here or elsewhere on that page? Please let us know, and we can continue tracking this as a request to improve the documentation. |
Thank @tim-finnigan . This part of documentation is only for successful update. In this case, I want to see original value if the update fails and that is missing in the documentation. It requires See this piece of code:
|
Thanks for your patience here, since the DynamoDB team owns the upstream DeleteItem API this would need to be addressed by their documentation team. And any updates would get reflected in the Boto3 (and other SDK) docs. We generally recommend using the Provide feedback links to send feedback directly the appropriate team. We can also reach out to service teams on your behalf. If you'd like us to do that please create an issue here in our cross-SDK repo for tracking: https://github.com/aws/aws-sdk/issues. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the bug
The
delete_item
is supposed to returnAttributes
field containing original content of item whenReturnValuesOnConditionCheckFailure
is set toALL_OLD
and condition fails, or in general, whenReturnValues
is set toALL_OLD
.This is not the case though. The successful operation returns the original content when
ReturnValues==ALL_OLD
, however upon condition failure, there is no such fields.This seems to be already reported in aws/aws-sdk-js-v3#5045 for javascript version. I suspect it's more a service error than the client errors and therefore affects all clients.
Expected Behavior
response.get('Attributes')
should be in the body when condition fails andReturnValuesOnConditionCheckFailure
is set toALL_OLD
.Current Behavior
response.get('Attributes')
is not present in the response.Reproduction Steps
Possible Solution
Return the
Attributes
field in the response.Additional Information/Context
No response
SDK version used
1.28.82
Environment details (OS name and version, etc.)
MacOs
The text was updated successfully, but these errors were encountered: