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

Commit

Permalink
Parse JSON floats as Decimal for DynamoDB
Browse files Browse the repository at this point in the history
  • Loading branch information
temetherian committed Apr 12, 2019
1 parent 302b8a7 commit 7dbbb68
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pdlwrapper/pdlwrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""

import boto3
import decimal
import requests
import time

Expand Down Expand Up @@ -37,7 +38,7 @@ def get_person(self, params):
'timestamp': int(round(time.time() * 1000000)),
'env': self.env,
'status_code': resp.status_code,
'response': resp.json()
'response': resp.json(parse_float=decimal.Decimal)
}

self.dynamodb_table.put_item(Item=log_item)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setuptools.setup(
name="pdlwrapper",
version="1.0",
version="1.1",
author="Tech For Campaigns",
license="MIT",
packages=setuptools.find_packages()
Expand Down

0 comments on commit 7dbbb68

Please sign in to comment.