Error: Float types are not supported. Use decimal types instead.

Answered by Rafal Wilinski
What's Causing This Error
This error occurs with the AWS Python SDK when trying to persist an item containing an attribute with a floating-point number. For example, you may encounter this error in Python if you try to save an item with a float (30.51) value.
Solution - Here's How To Resolve It
You can convert the floating-point attribute to a string using Python's str()
function.
dynamodb = boto3.resource('dynamodb') table = dynamodb.Table('my-custom-table') // using str will help avoid the floating point error. item = {'name': 'item_name', 'floating_attribute': str(our_value)} table.put_item(Item=item)
Other Common DynamoDB Errors (with Solutions)
- DynamoDB Scan Not Working
- DynamoDB string set may not be empty
- dynamodb the table does not have the specified index
- dynamodb update fail if not exists
- dynamodb not a managed type
- dynamodb table did not stabilize
- dynamodb system error cloudwatch
- dynamodb query is null
- dynamodb no range key value present
- dynamodb index not found
- DynamoDB is not showing all columns
- DynamoDB attribute not empty
- dynamodb-admin is not recognized as an internal or external command
- dynamodb index not updated
- DynamoDB Contains not working
Tired of switching accounts and regions? Use Dynobase.
Start your 7-day free trial today
Product Features
DynamoDB Tools
DynamoDB Info
© 2025 Dynobase