Skip to content

Replace legacy DeleteItem params#4364

Open
aanton-git wants to merge 10 commits intoaws:developmentfrom
aanton-git:feature/replace-legacy-parameter-DeleteItem
Open

Replace legacy DeleteItem params#4364
aanton-git wants to merge 10 commits intoaws:developmentfrom
aanton-git:feature/replace-legacy-parameter-DeleteItem

Conversation

@aanton-git
Copy link
Copy Markdown
Contributor

@aanton-git aanton-git commented Mar 23, 2026

Description

DeleteAsync<[DynamicallyAccessedMembers(InternalConstants.DataModelModeledType) ends up in DeleteHelperAsync<[DynamicallyAccessedMembers(InternalConstants.DataModelModeledType), which still uses legacy Expected and ConditionalOperator. AWS recommends ConditionExpression instead. Update delete request construction to use expression-based conditions.

Motivation and Context

• Context.Async.cs:184 → DeleteAsync<[DynamicallyAccessedMembers(InternalConstants.DataModelModeledType)
• Context.cs → DeleteHelperAsync<[DynamicallyAccessedMembers(InternalConstants.DataModelModeledType)
• Table.cs → DeleteHelperAsync<[DynamicallyAccessedMembers(InternalConstants.DataModelModeledType) builds DeleteItemRequest

Testing

-feature branch mocked client benchmarks

image

-development branch mocked client benchmarks

image

Breaking Changes Assessment

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • [ x] 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
  • [ x] I have added tests to cover my changes
  • [ x] All new and existing tests passed

License

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

Copy link
Copy Markdown
Contributor

@irina-herciu irina-herciu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sure all changes are covered with unit tests

Comment thread sdk/src/Services/DynamoDBv2/Custom/DataModel/Context.cs Outdated
Comment thread sdk/src/Services/DynamoDBv2/Custom/DataModel/Context.cs Outdated
Comment thread sdk/src/Services/DynamoDBv2/Custom/DataModel/Context.cs
Comment thread sdk/src/Services/DynamoDBv2/Custom/DataModel/Context.cs
Comment thread sdk/src/Services/DynamoDBv2/Custom/DocumentModel/DocumentOperationRequest.cs Outdated
Comment thread sdk/src/Services/DynamoDBv2/Custom/DocumentModel/DocumentOperationRequest.cs Outdated
Comment thread sdk/test/Services/DynamoDBv2/IntegrationTests/DataModelTests.cs Outdated
Comment thread generator/.DevConfigs/264e45e8-60ef-4e07-8f70-7fb4dc554187.json Outdated
@aanton-git aanton-git marked this pull request as ready for review April 1, 2026 07:34
@dscpinheiro
Copy link
Copy Markdown
Contributor

@irina-herciu @aanton-git I apologize but today's release included a massive refactoring of the SDK integration tests.

I updated them to: use xUnit for parallelism, target .NET 8 in addition to .NET Framework, and (for DynamoDB specifically) split the large document / data model tests into separate classes (new structure is https://github.com/aws/aws-sdk-net/tree/main/sdk/test/Services/DynamoDBv2/IntegrationTests).

Unfortunately you'll need to rebase your branches, but hopefully this change makes adding new tests / troubleshooting easier in the future (not to mention actually testing non net472 code paths).

@aanton-git aanton-git force-pushed the feature/replace-legacy-parameter-DeleteItem branch from 1459ec3 to 28d3796 Compare April 16, 2026 11:45
@aanton-git aanton-git force-pushed the feature/replace-legacy-parameter-DeleteItem branch from 28d3796 to f258868 Compare April 16, 2026 13:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the DynamoDBv2 DataModel delete flow to stop constructing legacy Expected/ConditionalOperator conditions and instead build expression-based ConditionExpression for version checks, aligning DeleteItem/DeleteItemAsync with AWS-recommended patterns.

Changes:

  • Refactors DataModel delete-by-entity path to build an internal document-model delete request that can carry a ConditionalExpression.
  • Introduces a shared delete request base type and updates the document-model delete pipeline/table helpers to accept it.
  • Adds/updates unit + integration tests to validate version-check and SkipVersionCheck delete behaviors.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
sdk/test/Services/DynamoDBv2/UnitTests/Custom/DataModel/ContextInternalTests.cs Adds versioned entity + unit tests validating ConditionExpression vs SkipVersionCheck.
sdk/test/Services/DynamoDBv2/IntegrationTests/DataModel/DataModelMultiTableTests.cs Adds integration coverage for delete with/without version checks.
sdk/src/Services/DynamoDBv2/Custom/DocumentModel/Table.cs Updates internal delete helper overloads to accept the new shared base request type.
sdk/src/Services/DynamoDBv2/Custom/DocumentModel/InternalDeleteItemDocumentOperationRequest.cs Adds internal request type used by DataModel delete path to pass low-level key + expressions.
sdk/src/Services/DynamoDBv2/Custom/DocumentModel/DocumentOperationRequest.cs Introduces BaseDeleteItemDocumentOperationRequest and moves delete expression/return-values members onto it.
sdk/src/Services/DynamoDBv2/Custom/DocumentModel/DocumentOperationPipeline.cs Updates delete pipeline to handle both public and internal delete request shapes.
sdk/src/Services/DynamoDBv2/Custom/DataModel/Context.cs Refactors delete-by-entity to use expression-based version condition via internal request.
generator/.DevConfigs/264e45e8-60ef-4e07-8f70-7fb4dc554187.json Adds DevConfig entry for the DynamoDBv2 change.

"services": [
{
"serviceName": "DynamoDBv2",
"type": "patch",
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New public API is being added/changed in this PR (e.g., introducing BaseDeleteItemDocumentOperationRequest and changing DeleteItemDocumentOperationRequest's base type). Per DevConfig guidance, this should likely be a minor bump rather than patch to reflect the public surface area change.

Suggested change
"type": "patch",
"type": "minor",

Copilot uses AI. Check for mistakes.
Comment thread sdk/src/Services/DynamoDBv2/Custom/DocumentModel/DocumentOperationPipeline.cs Outdated
Comment thread sdk/src/Services/DynamoDBv2/Custom/DocumentModel/DocumentOperationPipeline.cs Outdated
Comment thread sdk/test/Services/DynamoDBv2/UnitTests/Custom/DataModel/ContextInternalTests.cs Outdated
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.

4 participants