dynobase-icon
Dynobase

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

Rafal Wilinski

Answered by Rafal Wilinski

Last updated: October 23rd, 2026

Solution

Float types are not supported. Use decimal types instead. comes from boto3's DynamoDB serializer. It accepts Decimal and integer numbers but rejects Python float values, including floats nested inside lists or dictionaries.

from decimal import Decimal
import boto3
import json

table = boto3.resource("dynamodb").Table("Products")
table.put_item(Item={"pk": "product-1", "price": Decimal("30.51")})

item = json.loads('{"pk":"product-2","price":30.51}', parse_float=Decimal)
table.put_item(Item=item)

Parse the original decimal text when possible. Decimal(30.51) preserves the binary float approximation; Decimal(str(value)) is a practical conversion when a float already exists, but cannot recover precision previously lost. Inspect nested structures for remaining floats.

Converting a price to str merely to bypass the error stores a DynamoDB String and changes numeric comparisons and arithmetic. Use strings only when that is the intended model. Non-finite values such as infinity and NaN are not valid DynamoDB numbers.

See Python examples and AWS documentation.

Dynobase is a Professional GUI Client for DynamoDB

Start your 7-day free trial today

Product Features

Download
/
Changelog
/
Pricing
/
Member Portal
/
Privacy
/
EULA
/
Twitter
© 2026 Dynobase
+
Still using AWS DynamoDB Console?
Try Dynobase to accelerate your DynamoDB workflow. Start your 7-day free trial today.