fix: Improve handling of primary keys with property converters with DisableFetchingTableMetadata #3327
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.
Description
When using
DisableFetchingTableMetadata
in the object-persistence programming model, the SDK infers its understanding of a DynamoDB table and/or index's key structure based on the attributed data model, as opposed to callingDescribeTable
to load the actual table/index configuration.The data type of primary keys is expected to be one of our
DynamoDBEntryType
and can be represented by aPrimitive
.aws-sdk-net/sdk/src/Services/DynamoDBv2/Custom/DocumentModel/Primitive.cs
Lines 31 to 44 in 1b8348b
The SDK was throwing an exception for the case when:
UnconvertedDynamoDBEntry
(as opposed to aPrimitive
directly)Now, if a property converter returns an
UnconvertedDynamoDBEntry
for a property used in a key, the SDK will attempt to convert it again towards aPrimitive
. If it still cannot, I clarified the exception that is thrown.Motivation and Context
DOTNET-7524 -> #3323
Testing
Types of changes
Checklist
License