Repository navigation
delete_item doesn't return empty Attributes when specifying ALL_OLD ReturnValues #4220
Replies: 1 comment
|
For With So write the check as: response = table_resource.delete_item(
Key={"PK": "PK", "SK": "SK"},
ReturnValues="ALL_OLD",
)
old_item = response.get("Attributes")
if old_item is None:
# No previous item was returned.
...
else:
# old_item contains the deleted item's previous attributes.
...If older behavior happened to give you If you need the delete to occur only when the item exists, use a condition expression instead; then nonexistence is an explicit conditional failure rather than inferred from returned attributes. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
It used to be that deleting a non existing item would return an empty Attributes property in the response, but this seems to no longer be the case? When deleting a non existing item the property Attributes no longer exists in the response, when was this changed?
All reactions