Skip to content

Replace legacy params on SaveItem operations#4362

Open
irina-herciu wants to merge 9 commits intoaws:developmentfrom
irina-herciu:features/460_UpdateItemLegacyParams
Open

Replace legacy params on SaveItem operations#4362
irina-herciu wants to merge 9 commits intoaws:developmentfrom
irina-herciu:features/460_UpdateItemLegacyParams

Conversation

@irina-herciu
Copy link
Copy Markdown
Contributor

@irina-herciu irina-herciu commented Mar 20, 2026

Description

This PR migrates the internal SaveAsync update flow to use DynamoDB’s modern expression-based API.

Specifically, it replaces usage of legacy UpdateItem request fields (AttributeUpdates, Expected, and ConditionalOperator) with:

  • UpdateExpression
  • ConditionExpression
  • ExpressionAttributeNames
  • ExpressionAttributeValues

This aligns the .NET SDK with current DynamoDB API recommendations and eliminates reliance on deprecated request patterns.

Motivation and Context

The current implementation of SaveAsync ultimately calls:

UpdateHelperAsync(UpdateItemDocumentOperationRequest, CancellationToken)

which still constructs UpdateItemRequest using legacy fields:

  • AttributeUpdates
  • Expected
  • ConditionalOperator

These parameters are marked as legacy by AWS, with guidance to use expression-based APIs instead.

Migrating to expressions ensures:

  • Alignment with modern DynamoDB best practices
  • Consistency with other SDKs
  • Improved flexibility for future enhancements

Testing

  • Added/updated unit and integration tests covering:

    • Standard updates via SaveAsync
    • Conditional updates (previously using Expected)
    • Mixed update scenarios

Dry-run

  • Dry-run ID:
  • Status:
    • Pending
    • Completed successfully
    • Failed
  • Failed bypass reason:

Breaking Changes Assessment

  1. Identify all breaking changes including the following details:
    • What functionality was changed?
    • How will this impact customers?
    • Why does this need to be a breaking change and what are the most notable non-breaking alternatives?
    • Are best practices being followed?
    • How have you tested this breaking change?
  2. Has a senior/+ engineer been assigned to review this PR?

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have read the README document
  • I have added tests to cover my changes
  • All new and existing tests passed

License

  • I confirm that this pull request can be released under the Apache 2 license

@irina-herciu irina-herciu changed the title update item replace legacy params Replace legacy params on SaveItem operations Mar 23, 2026
@irina-herciu irina-herciu marked this pull request as ready for review March 23, 2026 13:50
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.

1 participant