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 validation error detected
- ExpressionAttributeValues contains invalid value: One or more parameter values were invalid: An AttributeValue may not contain an empty string
- DynamoDB FilterExpression Not Working
- DynamoDB Contains not working
- DynamoDB Network Error: self signed certificate in chain
- DynamoDB attribute not empty
- could not unconvert attribute dynamodb
- why is the GSI dynamodb not showing item count
- moto dynamodb not working
- dynamodb ttl not deleting / erasing items
- dynamodb streams missing events
- ImportError: No module named boto3 (DynamoDB)
- DynamoDB Local Cannot Create Preexisting Table
- DynamoDB Get not found
- aws.dynamodb.documentclient is not a constructor
Better DynamoDB experience.
First 7 days are. No credit card needed.
Product Features
DynamoDB Tools
DynamoDB Info
© 2026 Dynobase