Boto3 DynamoDB Client: Use batch_write_item or put_item with regular JSON structure, not dynamoDB JSON

0

I am using boto3 version 1.26.90 with python 3.10 and attempting to add a new object to a dynamoDB table. Dynamo has their own JSOn structure for table entries, where the type of the field is added so "key":"value" becomes "key":{"SS":"value"}. when using this version of boto3, it does not accept the classic json structure. I get an error saying Invalid type for parameter, type: <class 'str'>, valid types <class 'dict'>

I want to find a way to upload regularly structured json or an existing python method that will transform the data for me instead of me adding a programmatic transformation

Chris
asked 7 months ago432 views
1 Answer
2
Accepted Answer

To use native JSON you have two choices:

Both of which you can read more about in this Blog Post

profile pictureAWS
EXPERT
answered 7 months ago
profile pictureAWS
EXPERT
reviewed 7 months ago
  • Thank you for the response, I imported the serializer class and it works perfectly

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions