Skip to content

Commit

Permalink
Improve parsing DynamoDB begins_with expression
Browse files Browse the repository at this point in the history
A query fails if it has a space between `begins_with` and `(`,
for example: ```begins_with (getmoto#1, :1)```

Fix getmoto#1996
  • Loading branch information
shmygol committed Nov 21, 2019
1 parent 2af4e7a commit 6ea6001
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion moto/dynamodb2/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ def query(self):
]
elif "begins_with" in range_key_expression:
range_comparison = "BEGINS_WITH"
range_values = [value_alias_map[range_key_expression_components[1]]]
range_values = [value_alias_map[range_key_expression_components[-1]]]
else:
range_values = [value_alias_map[range_key_expression_components[2]]]
else:
Expand Down

0 comments on commit 6ea6001

Please sign in to comment.