Skip to content

fix: omit empty Attributes on UpdateItem UPDATED_NEW/UPDATED_OLD#121

Merged
pdf-amzn merged 1 commit into
ExtendDB:mainfrom
yesyayen:fix/update-item-empty-attributes-on-delete
May 28, 2026
Merged

fix: omit empty Attributes on UpdateItem UPDATED_NEW/UPDATED_OLD#121
pdf-amzn merged 1 commit into
ExtendDB:mainfrom
yesyayen:fix/update-item-empty-attributes-on-delete

Conversation

@yesyayen
Copy link
Copy Markdown
Contributor

What

UpdateItem with ReturnValues=UPDATED_NEW or UPDATED_OLD now matches DynamoDB when no targeted attribute is present in the chosen snapshot:

  • REMOVE / legacy DELETE on a Map attribute with UPDATED_NEW: response omits Attributes (was {"Attributes": {}}).
  • SET on a brand-new attribute with UPDATED_OLD: response omits Attributes (was {"Attributes": {}}).

Why

Closes #120

Testing done

Tested against real DynamoDB to confirm the expected behavior, then verified the fix against ExtendDB end-to-end. New tests:

  • 3 pytest tests in TestUpdateItem covering REMOVE + UPDATED_NEW, SET of a brand-new attribute + UPDATED_OLD, and legacy AttributeUpdates DELETE + UPDATED_NEW.

Checklist

  • I have read CONTRIBUTING.md
  • All tests pass (cargo test --workspace)
  • Code is formatted (cargo fmt --check)
  • Clippy is clean (cargo clippy --all-targets --workspace -- -D warnings)
  • I have added or updated tests for new functionality
  • I have updated documentation if behavior changed
  • Breaking changes are noted below (if any)

Breaking changes

None.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache License 2.0 and I agree to the Developer Certificate of Origin (DCO). See CONTRIBUTING.md for details.

@yesyayen yesyayen force-pushed the fix/update-item-empty-attributes-on-delete branch from f436fe1 to 7be239c Compare May 27, 2026 21:16
@pdf-amzn pdf-amzn force-pushed the fix/update-item-empty-attributes-on-delete branch from f14863f to bcc7fd3 Compare May 28, 2026 23:10
@pdf-amzn pdf-amzn merged commit 5ec827b into ExtendDB:main May 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] UpdateItem AttributeUpdates DELETE returns empty Attributes with UPDATED_NEW

2 participants