Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Numbers such as 1e100 cannot be retrieved from DynamoDB #4916

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions api/environments/dynamodb/wrappers/base.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
import typing
from decimal import Context
from functools import partial

import boto3
import boto3.dynamodb.types
from botocore.config import Config

if typing.TYPE_CHECKING:
from mypy_boto3_dynamodb.service_resource import Table


# Avoid `decimal.Rounded` when reading large numbers
# See https://github.com/boto/boto3/issues/2500
boto3.dynamodb.types.DYNAMODB_CONTEXT = Context(prec=100)


class BaseDynamoWrapper:
table_name: str = None

Expand Down
Loading