Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moto allows empty ExpressionAttributeValues in transaction put item #8405

Open
regoawt opened this issue Dec 16, 2024 · 0 comments
Open

Moto allows empty ExpressionAttributeValues in transaction put item #8405

regoawt opened this issue Dec 16, 2024 · 0 comments

Comments

@regoawt
Copy link

regoawt commented Dec 16, 2024

Hi,

Transact write items fails with An error occurred (ValidationException) when calling the TransactWriteItems operation: ExpressionAttributeValues must not be empty when making the request against DDB, but moto allows it:

[
  {
    "Update": {
      "Key": { "pk": { "S": "globals" }, "sk": { "S": "globals" } },
      "UpdateExpression": "SET #0 = :0",
      "ExpressionAttributeNames": { "#0": "tenant_count" },
      "ExpressionAttributeValues": { ":0": { "N": "1" } },
      "TableName": "Table1"
    }
  },
  {
    "Put": {
      "Item": { "pk": { "S": "tenant#0000001-tenant#0000001" }, "sk": { "S": "tenant#0000001" } },
      "ConditionExpression": "attribute_not_exists(#n0)",
      "TableName": "Table1",
      "ExpressionAttributeNames": { "#n0": "pk" },
      "ExpressionAttributeValues": {}
    }
  }
]

The Update operation works fine but the Put should raise an error.

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

No branches or pull requests

1 participant