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 ConditionalCheckFailedException
- DynamoDB scan filter not working
- dynamodb index not updated
- dynamodb user errors metric
- dynamodb number_value cannot be converted to string
- dynamodb unable to find storage information for property
- dynamodb request is missing authentication token
- dynamodb could not connect to the endpoint url
- DynamoDB cannot delete the table
- DynamoDB cannot do operations on a non-existent table
- can't pickle thread.lock objects typeerror boto3 python dynamodb
- dynamodb unable to execute http request
- dynamodb type custid is not supported
- boto3 dynamodb client error
- DynamoDB missing items
Dynobase is a Professional GUI Client for DynamoDB
First 7 days are. No credit card needed.
Product Features
DynamoDB Tools
DynamoDB Info
© 2024 Dynobase