-
Notifications
You must be signed in to change notification settings - Fork 875
Description
Describe the bug
This bug is similar to #3802 (could not use conditional expressions without supplying ExpressionAttributeValues in PutItemAsync()) which has been fixed (#3804) but the issue remains for UpdateItemAsync(). This worked in V3 of the SDK (AWSSDK.DynamoDBv2 3.7.404.11)
Regression Issue
- Select this option if this issue appears to be a regression.
Expected Behavior
The operation should succeed as it did with V3 of the SDK.
Current Behavior
The operation throws the following exception:
AmazonDynamoDBException: ExpressionAttributeValues must not be empty
The behavior is the same, even if ExpressionAttributeValues is explicitly set to null or an empty collection.
Reproduction Steps
await table.UpdateItemAsync(document, new UpdateItemOperationConfig
{
ConditionalExpression = new Expression { ExpressionStatement = "attribute_not_exists(pk)" }
};
Possible Solution
Two workarounds:
Setting
Amazon.AWSConfigs.InitializeCollections = true;
or
including unnecessary values in ExpressionStatement and ExpressionAttributeValues.
The solution for PutItemAsync() was solved in (#3804)
Additional Information/Context
No response
AWS .NET SDK and/or Package version used
AWSSDK.DynamoDBv2 4.0.6.4
Targeted .NET Platform
.Net 8
Operating System and version
Windows 11