Skip to content

Commit

Permalink
fix: Revert 2d1c64f ("Handle JSON numbers as Decimal not float")
Browse files Browse the repository at this point in the history
1e9999 causes ValueError: "Exceeds the limit (4300) for integer string conversion; use sys.set_int_max_str_digits() to increase the limit"

cove-ocds, to my knowledge, doesn't perform arithmetic on floats, and in any case, it is a review tool, not a statistical tool.
  • Loading branch information
jpmckinney committed Feb 6, 2024
1 parent d8cdd90 commit 50732d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cove_ocds/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def explore_ocds(request, pk):
# open the data first so we can inspect for record package
with open(file_name, encoding="utf-8") as fp:
try:
json_data = json.load(fp, parse_float=Decimal)
json_data = json.load(fp)
except UnicodeError as err:
raise CoveInputDataError(
context={
Expand Down Expand Up @@ -223,7 +223,7 @@ def explore_ocds(request, pk):
)

with open(context["converted_path"], encoding="utf-8") as fp:
json_data = json.load(fp, parse_float=Decimal)
json_data = json.load(fp)

if replace:
if os.path.exists(validation_errors_path):
Expand Down

0 comments on commit 50732d2

Please sign in to comment.