Strip parenthesis in the KeyConditionExpression

The "bloop" package uses parenthesis in the KeyConditionExpression, so query method returns nothing due to the wrong parsing of the parameters.
This commit is contained in:
vadym-serdiuk 2018-11-28 17:33:22 +02:00 committed by GitHub
parent ed861ecae1
commit 5a3b5cab29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -311,7 +311,7 @@ class DynamoHandler(BaseResponse):
def query(self):
name = self.body['TableName']
# {u'KeyConditionExpression': u'#n0 = :v0', u'ExpressionAttributeValues': {u':v0': {u'S': u'johndoe'}}, u'ExpressionAttributeNames': {u'#n0': u'username'}}
key_condition_expression = self.body.get('KeyConditionExpression')
key_condition_expression = self.body.get('KeyConditionExpression').strip('()')
projection_expression = self.body.get('ProjectionExpression')
expression_attribute_names = self.body.get('ExpressionAttributeNames', {})
filter_expression = self.body.get('FilterExpression')