Merge pull request #1878 from garyd203/dynamodb2-compare-keys-to-list

Don't compare a dict_keys object to a list, since it is always False
This commit is contained in:
Steve Pulec 2018-10-16 23:23:07 -04:00 committed by GitHub
commit c52a408a56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -265,9 +265,9 @@ class Item(BaseModel):
self.attrs[attribute_name] = DynamoType({"SS": new_value})
elif isinstance(new_value, dict):
self.attrs[attribute_name] = DynamoType({"M": new_value})
elif update_action['Value'].keys() == ['N']:
elif set(update_action['Value'].keys()) == set(['N']):
self.attrs[attribute_name] = DynamoType({"N": new_value})
elif update_action['Value'].keys() == ['NULL']:
elif set(update_action['Value'].keys()) == set(['NULL']):
if attribute_name in self.attrs:
del self.attrs[attribute_name]
else: