cleanup after merge
This commit is contained in:
parent
91657a537b
commit
b713eef491
@ -317,15 +317,17 @@ class DynamoHandler(BaseResponse):
|
|||||||
index = table.schema
|
index = table.schema
|
||||||
|
|
||||||
reverse_attribute_lookup = dict((v, k) for k, v in
|
reverse_attribute_lookup = dict((v, k) for k, v in
|
||||||
six.iteritems(self.body['ExpressionAttributeNames']))
|
six.iteritems(self.body['ExpressionAttributeNames']))
|
||||||
|
|
||||||
if " AND " in key_condition_expression:
|
if " AND " in key_condition_expression:
|
||||||
expressions = key_condition_expression.split(" AND ", 1)
|
expressions = key_condition_expression.split(" AND ", 1)
|
||||||
|
|
||||||
index_hash_key = [key for key in index if key['KeyType'] == 'HASH'][0]
|
index_hash_key = [key for key in index if key['KeyType'] == 'HASH'][0]
|
||||||
hash_key_var = reverse_attribute_lookup.get(index_hash_key['AttributeName'], index_hash_key['AttributeName'])
|
hash_key_var = reverse_attribute_lookup.get(index_hash_key['AttributeName'],
|
||||||
|
index_hash_key['AttributeName'])
|
||||||
hash_key_regex = r'(^|[\s(]){0}\b'.format(hash_key_var)
|
hash_key_regex = r'(^|[\s(]){0}\b'.format(hash_key_var)
|
||||||
i, hash_key_expression = next((i, e) for i, e in enumerate(expressions) if re.search(hash_key_regex, e))
|
i, hash_key_expression = next((i, e) for i, e in enumerate(expressions)
|
||||||
|
if re.search(hash_key_regex, e))
|
||||||
hash_key_expression = hash_key_expression.strip('()')
|
hash_key_expression = hash_key_expression.strip('()')
|
||||||
expressions.pop(i)
|
expressions.pop(i)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user