Using PynamoDB to put an item with new attributes

845 Views Asked by At

I have existing DynamoDB tables created through an infrastructure-as-code implementation.

I used TableConnection to connect to the existing table and run the lower level command put_item.

My table is defined with a hash key (userId) and sort key (transactionId).

I want to put an item with additional attributes (timestamp, symbol, quantity).

I have not defined these additional attributes.

When I run the following command:

table = TableConnection('ExistingTable')
table.put_item(user_id, transaction_id, attributes={...})

I receive the following error:

ValueError: No attribute timestamp in ['userId', 'transactionId']

How do I put an item without defining the attributes previously?

0

There are 0 best solutions below