I am trying to update a dynamodb table in AWS which has two keys. One column "col1" is the Hash key and the column "col2" is the range key. It has no GSIs.
In addition to col1, and col2, there are two columns col3 and col4 which are not indexes but they have a value.
All 4 columns are of type String including the indexes.
I am trying to create a new column col5 with the below code and I receive this error message "An error occurred (ValidationException) when calling the UpdateItem operation: The provided key element does not match the schema"
response = table.update_item(
Key={
'col1': col1_var,
'col2': col2_var
},
UpdateExpression="SET col5 = :col5_var, col6 = :col6_var",
ExpressionAttributeValues={
':col5_var': str(datetime.datetime.now()),
':col6_var': post_api_response
}
)