Insert Number into DynamoDB table using Boto3

Viewed 1328

My Problem:

I am trying to insert a Number attribute through boto3 Python. Which is not getting inserted into the DynamoDB table.

What I tried:

Data:

{
   "TTLTimeStamp": 1616648865, #Integer
   "Seconds": 45 , #Integer
   "CreatedDateTimeUTC":"2021-03-25T10:36:45"
}

Code:

dynamo_db_client = boto3.resource('dynamodb')

table = dynamo_db_client.Table("table_name")

with table.batch_writer() as batch:
    for row in row_list:
        try:
            batch.put_item(Item=row) #Data Object as above
        except Exception as ex:
            raise ex

Unable to insert the above data if it contains Number type.

Kindly help me to get rid off this issue.

1 Answers
Related