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 unable to locate credentials
- DynamoDB Not Supported Requires @DynamoDBTyped Or @DynamoDBTypeConverted
- aws.dynamodb.converter.unmarshall not working
- dynamodb could not instantiate class
- DynamoDB Error Message KeyError item is not JSON serializable
- CORS Error DynamoDB
- dynamodb cannot read property 'push' of undefined
- DynamoDB ConditionalCheckFailedException
- dynamodb botocore.exceptions.nocredentialserror unable to locate credentials
- AWS DynamoDB errors ResourceNotFoundException
- dynamodb put function not working
- resourcenotfoundexception dynamodb nodejs
- failed to list tables not authorized dynamodb
- One or more parameter values were invalid: some AttributeDefinitions are not used
- DynamoDB Internal Server Error
Spend less time in the AWS console, use Dynobase.
Try 7-day free trial. No credit card needed.
Product Features
DynamoDB Tools
DynamoDB Info
© 2025 Dynobase