Merge pull request #1127 from brianrower/feature/add-string-set
Dynamodb2 - Allow doing an ADD update_item of a string set
This commit is contained in:
commit
d7e64fc927
2 changed files with 36 additions and 0 deletions
|
|
@ -172,6 +172,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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue