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

Add ReturnValuesOnConditionCheckFailure member to Update & Put Enhanced Request #4442

Closed
1 of 2 tasks
masakiasanuma opened this issue Sep 17, 2023 · 7 comments
Closed
1 of 2 tasks
Labels
dynamodb-enhanced feature-request A feature should be added or improved.

Comments

@masakiasanuma
Copy link

masakiasanuma commented Sep 17, 2023

Describe the feature

Currently, only UpdateItemRequest and PutItemRequest using the non-enhanced Dynamo DB client allows you to set the ReturnValuesOnConditionCheckFailure member to make the ConditionalCheckFailedException to return the failed item. I want this member to be added to the UpdateItemEnhancedRequest and PutItemEnhancedRequest so that this feature can be used with the enhanced Dynamo DB client.

Use Case

My service currently uses multiple conditions when creating & updating items, and there's no way to differentiate which condition failed without retrieving & checking the item that failed in the ConditionalCheckFailedException object. With the ReturnValuesOnConditionCheckFailure feature, my service will be able to throw specific exceptions based on which condition failed, allowing the service clients to handle exceptions more clearly.

Proposed Solution

Add an optional returnValuesOnConditionCheckFailure member to UpdateItemEnhancedRequest.builder and PutItemEnhancedRequest.builder that takes in the ReturnValuesOnConditionCheckFailure Enum. When this member is set to ALL_OLD, it will append the failed/old item as a Map<String, AttributeValue> in the ConditionalCheckFailedException object.

Other Information

I believe this was a recent feature added based on the announcement date, which might be the reason this was not added to the Enhanced requests yet.

Somewhat similar to this issue, but I specifically need the value to be returned on ConditionalCheckFailedException. The ReturnValues attribute does not return the item in the exception object, it only returns when the operation succeeds.

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS Java SDK version used

2

JDK version used

17

Operating System and version

AL2

@masakiasanuma masakiasanuma added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Sep 17, 2023
@debora-ito
Copy link
Member

@masakiasanuma thank you for reaching out. Request acknowledged.

Community note: add a 👍 reaction to the original description to help us prioritize this request.

@debora-ito debora-ito added dynamodb-enhanced and removed needs-triage This issue or PR still needs to be triaged. labels Sep 18, 2023
@masakiasanuma
Copy link
Author

Hi @debora-ito, thank you for picking this up! Just curious, is there an average ETA for the completion of these kind of requests? I want to determine if it's worth implementing a workaround for now or if I should just wait until this feature request is completed. Thanks!

@breader124
Copy link
Contributor

Hi, I'd like to start working on it if possible

@masakiasanuma
Copy link
Author

Hi @breader124, it seems like they have not started working on this yet as they might not have enough bandwidth to prioritize this request over others. If you have the time, I would very much appreciate it if you could implement this feature!

breader124 added a commit to breader124/aws-sdk-java-v2 that referenced this issue Nov 16, 2023
breader124 added a commit to breader124/aws-sdk-java-v2 that referenced this issue Nov 18, 2023
breader124 added a commit to breader124/aws-sdk-java-v2 that referenced this issue Nov 19, 2023
breader124 added a commit to breader124/aws-sdk-java-v2 that referenced this issue Nov 19, 2023
breader124 added a commit to breader124/aws-sdk-java-v2 that referenced this issue Nov 19, 2023
breader124 added a commit to breader124/aws-sdk-java-v2 that referenced this issue Nov 19, 2023
breader124 added a commit to breader124/aws-sdk-java-v2 that referenced this issue Nov 19, 2023
breader124 added a commit to breader124/aws-sdk-java-v2 that referenced this issue Nov 19, 2023
breader124 added a commit to breader124/aws-sdk-java-v2 that referenced this issue Nov 19, 2023
anirudh9391 added a commit that referenced this issue Dec 1, 2023
…ure in DynamoDB Enhanced operations (#4708)

* Add returnValuesOnConditionCheckFailure param to UpdateItemEnhancedRequest (#4442)

* Add returnValuesOnConditionCheckFailure param to DeleteItemEnhancedRequest (#4442)

* Add returnValuesOnConditionCheckFailure param to PutItemEnhancedRequest (#4442)

* Cover returnValuesOnConditionCheckFailure changes with integration tests (#4442)

* Document new returnValuesOnConditionCheckFailure related API (#4442)

* Extend changelog by description of returnValuesOnConditionCheckFailure related changes (#4442)

* Fix minor codestyle issues (#4442)

---------

Co-authored-by: anirudh9391 <anirudh93@gmail.com>
@debora-ito
Copy link
Member

This is now supported, via #4708.

Available in version 2.21.37. Thank you @breader124 for your contribution!

Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@masakiasanuma
Copy link
Author

Thank you @debora-ito and @breader124!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dynamodb-enhanced feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

3 participants