0

I am trying to write a lambda function to write a list to s3 object. Below is my function.

print result,type(result)  
a =s3.put_object(Bucket='mybucket',key='data.json',Body=json.dumps(result))

error

[{u'Vote': Decimal('5'), u'Name': u'Akbar'}, {u'Vote': Decimal('4'), u'Name': >u'Amar'}, {u'Vote': Decimal('2'), u'Name': u'Antony'}, {u'Vote': Decimal('15'), >u'Name': u'Yunoth'}] ' type 'list'

TypeError: Decimal('5') is not JSON serializable

Community
  • 1
  • 1
Yunoth
  • 13
  • 8

0 Answers0