so I'm trying to place a dictionary into a dynamodb table, yet I keep getting the error:
ERROR TypeError: cannot pickle '_thread.lock' object
The code is below:
def send_to_dynamo():
message = receive_from_queue()
database = boto3.resource('dynamodb')
table = database.Table("Email_Service")
logger.info(message)
logger.info(type(message))
table.put_item(
TableName = table,
Item= message)
The message in question is :
dict = {'subject': {"S": "Test email output"},
'recipients': {"S":"email@email.com"},
'main_body': {"S":"This is to test"},
'send_time': {"S":"17:30"},
SORT_KEY : {"N":202211101157},
PARTITION_KEY : {"S":"servicename1"}}
I'm struggling a lot to figure out how to add a dictionary into a dynamodb table : (
Any help would be super appreciated!