How can I pass a variable name in Dynamocdb UpdateExpression, using python.
file is the variable that i want to put in UpdateExpression. When I use like below it gives me
"[ERROR] ClientError: An error occurred (ValidationException) when calling the UpdateItem operation: The document path provided in the update expression is invalid for update
response = table.update_item(
Key={"runid": item["runid"]},
UpdateExpression="SET " + file + "= :val1, update_date = :val2",
ExpressionAttributeValues={
":val1": item[file],
":val2": item["update_date"],
}