-
Notifications
You must be signed in to change notification settings - Fork 877
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
Fixed EnhancedClient UpdateItem operation to make it work on nested attributes as well #5380
Conversation
…ttributes as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR also needs a changelog item.
.../software/amazon/awssdk/enhanced/dynamodb/internal/DynamoDBEnhancedRequestConfiguration.java
Outdated
Show resolved
Hide resolved
.../software/amazon/awssdk/enhanced/dynamodb/internal/DynamoDBEnhancedRequestConfiguration.java
Outdated
Show resolved
Hide resolved
...enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/mapper/AttributeMapping.java
Outdated
Show resolved
Hide resolved
...om/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/TableSchema.java
Outdated
Show resolved
Hide resolved
...om/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/TableSchema.java
Outdated
Show resolved
Hide resolved
...om/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/TableSchema.java
Outdated
Show resolved
Hide resolved
...ced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/EnhancedClientUtils.java
Outdated
Show resolved
Hide resolved
.../software/amazon/awssdk/enhanced/dynamodb/internal/DynamoDBEnhancedRequestConfiguration.java
Outdated
Show resolved
Hide resolved
...in/java/software/amazon/awssdk/enhanced/dynamodb/mapper/annotations/DynamoDbIgnoreNulls.java
Outdated
Show resolved
Hide resolved
It will be great if we mention the user experience in the description with these changes since these changes are made in Public classes
|
...om/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/TableSchema.java
Outdated
Show resolved
Hide resolved
...om/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/TableSchema.java
Outdated
Show resolved
Hide resolved
.../src/test/java/software/amazon/awssdk/enhanced/dynamodb/mapper/MappingConfigurationTest.java
Outdated
Show resolved
Hide resolved
...enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/mapper/AttributeMapping.java
Outdated
Show resolved
Hide resolved
Is there any timeline for getting this fix merged? I'm working on a project that would benefit from using this fix. |
Yes, this fix involves non-trivial changes to behaviour that break backwards compatibility. We are working on getting the required documentation changes to eventually get this merged in. |
I modified it so that an empty map is stored and preserved. Wrote an integ test that validates it
|
Seems like this is testing out a case where the customer uses an enhancedClient for the update but a lower level client for get ? I have modified it so that we store empty map values in the table, but try testing this out using the enhanced client like this
|
...c/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/UpdateBehaviorTest.java
Outdated
Show resolved
Hide resolved
...c/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/UpdateBehaviorTest.java
Outdated
Show resolved
Hide resolved
...n/java/software/amazon/awssdk/enhanced/dynamodb/internal/operations/UpdateItemOperation.java
Show resolved
Hide resolved
...ain/java/software/amazon/awssdk/enhanced/dynamodb/internal/update/UpdateExpressionUtils.java
Outdated
Show resolved
Hide resolved
...ced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/EnhancedClientUtils.java
Outdated
Show resolved
Hide resolved
Thank you so much for handling the changes. Unfortunately, I wasn't able to test further due to some other issues. Could you kindly confirm if the following cases work as expected? (Covering all possible AttributeValues-Link) There’s no need to write additional test cases, but a quick integration test would be greatly appreciated. |
|
|
This backwards incompatible change broke our existing code that relied on this behavior. I cut #5584 to track that. |
Modified Enhanced Client to facilitate nested update operations.
Motivation and Context
Customer reported an issue where UpdateItem does not work for nested attributes.
Modifications
Modified UpdateItem query path to form the right updateQuery for nested update attributes.
Previously nested update queries looked like
This operates like a putItem and updates the map with a new state.
Intead modified the update query to
Testing
Unit Tests pass
Screenshots (if appropriate)
Types of changes