Fix wrong type if exists

This commit is contained in:
Kosei Kitahara 2018-10-12 16:08:05 +09:00
parent dfa7935e13
commit cf157287e7
No known key found for this signature in database
GPG Key ID: D18883191F02241B

View File

@ -162,12 +162,13 @@ class Item(BaseModel):
# If it already exists, get its value so we dont overwrite it
if path in self.attrs:
value = self.attrs[path].cast_value
value = self.attrs[path]
if value in expression_attribute_values:
value = DynamoType(expression_attribute_values[value])
else:
value = DynamoType({"S": value})
if type(value) != DynamoType:
if value in expression_attribute_values:
value = DynamoType(expression_attribute_values[value])
else:
value = DynamoType({"S": value})
if '.' not in key:
self.attrs[key] = value