From a5e947ddda81846c8197d28dafb89979c0ee27b1 Mon Sep 17 00:00:00 2001 From: Jeremy Lujan Date: Tue, 21 May 2019 13:47:33 -0500 Subject: [PATCH 1/4] Pass kwargs to json.dumps in singer.format_message Allow configuring json encoder by passing kwargs through to json.dumps in singer.format_message. Use case is passing data from pandas.DataFrame containing NaN to encode as `null` --- singer/messages.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/singer/messages.py b/singer/messages.py index 0602cf5..47e3f96 100644 --- a/singer/messages.py +++ b/singer/messages.py @@ -209,8 +209,10 @@ def parse_message(msg): return None -def format_message(message): - return json.dumps(message.asdict(), use_decimal=True) +def format_message(message, **kwargs): + return json.dumps(message.asdict(), + use_decimal=kwargs.pop('use_decimal', True), + **kwargs) def write_message(message): From 42c323eb605177a4190d0e21e3301150836649b1 Mon Sep 17 00:00:00 2001 From: Jeremy Lujan Date: Mon, 1 Jul 2019 14:34:27 -0500 Subject: [PATCH 2/4] rev simplejson version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 9be4c05..5861268 100755 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ install_requires=[ 'pytz==2018.4', 'jsonschema==2.6.0', - 'simplejson==3.11.1', + 'simplejson>=3.16.0', 'python-dateutil>=2.6.0', 'backoff==1.3.2', ], From 3afc636fe497c990c0eecb86fb14bf6864feb195 Mon Sep 17 00:00:00 2001 From: Jeremy Lujan Date: Mon, 1 Jul 2019 14:45:12 -0500 Subject: [PATCH 3/4] Rev jsonschema version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5861268..67d8629 100755 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ url="http://singer.io", install_requires=[ 'pytz==2018.4', - 'jsonschema==2.6.0', + 'jsonschema>=2.6.0', 'simplejson>=3.16.0', 'python-dateutil>=2.6.0', 'backoff==1.3.2', From f609a99e64beb9d32f3a92735c0f93939476fd55 Mon Sep 17 00:00:00 2001 From: Jeremy Lujan Date: Mon, 1 Jul 2019 14:52:12 -0500 Subject: [PATCH 4/4] Rev pytz version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 67d8629..5a392f1 100755 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ classifiers=['Programming Language :: Python :: 3 :: Only'], url="http://singer.io", install_requires=[ - 'pytz==2018.4', + 'pytz>=2019.1', 'jsonschema>=2.6.0', 'simplejson>=3.16.0', 'python-dateutil>=2.6.0',