fix(dynamodb): add test for put_item with ReturnValues='ALL_OLD' on new items#9778
Open
thakoreh wants to merge 1 commit intogetmoto:masterfrom
Open
fix(dynamodb): add test for put_item with ReturnValues='ALL_OLD' on new items#9778thakoreh wants to merge 1 commit intogetmoto:masterfrom
thakoreh wants to merge 1 commit intogetmoto:masterfrom
Conversation
…ues='ALL_OLD' (GH#9757)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9778 +/- ##
=======================================
Coverage 93.11% 93.11%
=======================================
Files 1308 1308
Lines 118798 118798
=======================================
+ Hits 110615 110617 +2
+ Misses 8183 8181 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bpandola
reviewed
Mar 4, 2026
|
|
||
| # Test 3: Put a NEW item with ReturnValues='ALL_OLD' - should return empty Attributes map | ||
| # This is the correct AWS behavior: when putting a new item that doesn't exist, | ||
| # ReturnValues='ALL_OLD' should return {"Attributes": {}} not omit the key |
Collaborator
There was a problem hiding this comment.
Doesn't this comment contradict #9757, which says "in the case of a new entry, DynamoDB itself doesn't include an Attributes attribute in the response"? You are saying here that the key should not be omitted--were you able to verify that against a real AWS backend?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Related to #9757
Adds a test case verifying that
put_item()withReturnValues='ALL_OLD'returns an empty Attributes map when creating a new item (not replacing an existing one).Behavior
Per AWS DynamoDB documentation:
ReturnValues='ALL_OLD'returns the old item attributes if an item was replaced{"Attributes": {}}Test Added
test_put_item_return_values_all_old_new_item- verifies the empty Attributes response for new items.