I would like to make my update_item operation idempotent. I have an attribute of type list, and I would like to add a element to list only if not exists. I imagine that i need to use: ConditionExpression
uptd = 'SET status_pedido_disponiveis = list_append(if_not_exists(status_pedido_disponiveis, :empty_list), :my_value)'
attr={ ":my_value": {"L": [{"S": xml }]}, ":empty_list":{"L": [] } }
self.dynamodb.update_item(TableName=self.table_name, Key={'order_id':{'S': order_id}},
UpdateExpression=uptd,
ExpressionAttributeValues=attr
)