DynamoDB - Send item to DDB Stream on update, not just on create

This commit is contained in:
Bert Blommers 2020-02-18 11:49:55 +00:00
commit 9971bcdfcd
2 changed files with 68 additions and 1 deletions

View file

@ -1406,6 +1406,7 @@ class DynamoDBBackend(BaseBackend):
range_value = None
item = table.get_item(hash_value, range_value)
orig_item = copy.deepcopy(item)
if not expected:
expected = {}
@ -1439,6 +1440,8 @@ class DynamoDBBackend(BaseBackend):
)
else:
item.update_with_attribute_updates(attribute_updates)
if table.stream_shard is not None:
table.stream_shard.add(orig_item, item)
return item
def delete_item(