Skip to content

fix(dynamodb): reject redundant condition-expression parentheses#9851

Closed
SergioChan wants to merge 1 commit intogetmoto:masterfrom
SergioChan:fix-dynamodb-redundant-parentheses
Closed

fix(dynamodb): reject redundant condition-expression parentheses#9851
SergioChan wants to merge 1 commit intogetmoto:masterfrom
SergioChan:fix-dynamodb-redundant-parentheses

Conversation

@SergioChan
Copy link
Contributor

Summary

  • reject redundant boolean-group parentheses in DynamoDB condition expressions when the grouped clause does not change precedence (for example a OR (b AND c))
  • raise InvalidConditionExpression with AWS-aligned message The expression has redundant parentheses;
  • add regression coverage for both the rejected redundant case and an allowed precedence-changing case (a AND (b OR c))

Testing

  • python -m pytest tests/test_dynamodb/test_dynamodb_condition_expressions.py -k "redundant_parentheses or allows_required_parentheses"
  • python -m pytest tests/test_dynamodb/test_dynamodb_condition_expressions.py

Related

Fixes #9574

@bpandola
Copy link
Collaborator

This was already submitted (and merged) as #9847

@bpandola bpandola closed this Mar 11, 2026
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.

Dynamodb doesn't catch redundant parenthesis error on condition expression

2 participants