Skip to content

Commit

Permalink
ScheduleOrder: Adding driver field to DynamoDB record update
Browse files Browse the repository at this point in the history
  • Loading branch information
enrique-ayala committed Apr 17, 2024
1 parent 2083bd0 commit dff3f11
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ def update_records(self, records: List[Dict[str, Any]]) -> Dict[str, Any]:
"""
try:
for record in records:
update_expression = "SET delivery_sequence = :val, #status = :statusVal"
update_expression = "SET delivery_sequence = :val, #status = :statusVal, #driver = :driverVal"
expression_attribute_values = {
":val": record["delivery_sequence"],
":statusVal": "Programada",
":driverVal": record["driver"],
}
expression_attribute_names = {"#status": "status"}

expression_attribute_names = {"#status": "status", "#driver": "driver"}
self.table.update_item(
Key={'delivery_date': record['delivery_date'], 'id': record['id']},
UpdateExpression=update_expression,
Expand Down

0 comments on commit dff3f11

Please sign in to comment.