Allow doing an ADD update of a string set

Fix test
This commit is contained in:
Brian Rower 2017-09-11 12:06:24 -07:00
commit 386ac94abe
2 changed files with 36 additions and 0 deletions

View file

@ -171,6 +171,12 @@ class Item(BaseModel):
decimal.Decimal(existing.value) +
decimal.Decimal(new_value)
)})
elif set(update_action['Value'].keys()) == set(['SS']):
existing = self.attrs.get(attribute_name, DynamoType({"SS": {}}))
new_set = set(existing.value).union(set(new_value))
self.attrs[attribute_name] = DynamoType({
"SS": list(new_set)
})
else:
# TODO: implement other data types
raise NotImplementedError(