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 docker unable to open database file
- dynamodb streams missing events
- DynamoDB FilterExpression Not Working
- AWS CLI DynamoDB Error Parsing Parameter
- DynamoDB No Provisioned Throughput specified for the table
- DynamoDB Is Unsupported It Cannot Be Instantiated
- dynamodb condition does not exist
- AWS Lambda DynamoDB Stream Error
- error updating dynamodb table time to live
- DynamoDB Mapper Could Not Instantiate Class
- dynamodb botocore.exceptions.nocredentialserror unable to locate credentials
- dynamodb the table does not have the specified index
- dynamodb system errors metric
- DynamoDB Error 413
- DynamoDB Item Does Not Exist
Spend less time in the AWS console, use Dynobase.
First 7 days are on us. No strings attached.
Product Features
DynamoDB Tools
DynamoDB Info
© 2025 Dynobase