Skip to content
This repository was archived by the owner on Oct 3, 2021. It is now read-only.

Commit eb23016

Browse files
authored
Merge pull request #1 from tfc-code/floats-as-decimal
Parse JSON floats as Decimal for DynamoDB
2 parents 302b8a7 + 7dbbb68 commit eb23016

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pdlwrapper/pdlwrapper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44

55
import boto3
6+
import decimal
67
import requests
78
import time
89

@@ -37,7 +38,7 @@ def get_person(self, params):
3738
'timestamp': int(round(time.time() * 1000000)),
3839
'env': self.env,
3940
'status_code': resp.status_code,
40-
'response': resp.json()
41+
'response': resp.json(parse_float=decimal.Decimal)
4142
}
4243

4344
self.dynamodb_table.put_item(Item=log_item)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setuptools.setup(
44
name="pdlwrapper",
5-
version="1.0",
5+
version="1.1",
66
author="Tech For Campaigns",
77
license="MIT",
88
packages=setuptools.find_packages()

0 commit comments

Comments
 (0)