From 635c657575db245c4fbd45a8fbadac7b81cba88b Mon Sep 17 00:00:00 2001 From: Pat Nadolny Date: Fri, 3 Nov 2023 09:48:06 -0400 Subject: [PATCH] Handle Decimals similar to SDK --- target_singer_jsonl/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/target_singer_jsonl/__init__.py b/target_singer_jsonl/__init__.py index 71bd94f..f5b7793 100644 --- a/target_singer_jsonl/__init__.py +++ b/target_singer_jsonl/__init__.py @@ -113,7 +113,10 @@ def persist_lines(config, lines): # Loop over lines from stdin for line in lines: try: - message = json.loads(line) + message = json.loads( + line, + parse_float=decimal.Decimal, + ) except json.decoder.JSONDecodeError: logger.error(f"Unable to parse:\n{line}") raise