Skip to content

Commit c67d306

Browse files
authored
Merge pull request #4 from drewpearce/float-decimal-fix
Cast floats to decimal.Decimal for dynamodb put
2 parents 4a6cd64 + d206044 commit c67d306

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Changelog
22
=========
33

4+
## [v0.0.26] - 2024-05-24
5+
6+
- Cast floats to decimal.Decimal for dynamodb put
7+
48
## [v0.0.25] - 2024-05-21
59
- Azure Cosmos update fix
610

abnosql/plugins/table/dynamodb.py

+1
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ def put_item(
197197
audit_user: t.Optional[str] = None
198198
) -> t.Dict:
199199
item, _ = put_item_pre(self, item, update, audit_user)
200+
item = json.loads(json.dumps(item), parse_float=Decimal)
200201

201202
# do update
202203
if update is True:

abnosql/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '0.0.25'
1+
__version__ = '0.0.26'
22

33

44
if __name__ == '__main__':

0 commit comments

Comments
 (0)