singer-python 6.0.1__tar.gz → 6.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- singer-python-6.1.0/PKG-INFO +9 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/setup.py +1 -1
- {singer-python-6.0.1 → singer-python-6.1.0}/singer/messages.py +4 -4
- singer-python-6.1.0/singer_python.egg-info/PKG-INFO +9 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/tests/test_singer.py +26 -0
- singer-python-6.0.1/PKG-INFO +0 -20
- singer-python-6.0.1/singer_python.egg-info/PKG-INFO +0 -20
- {singer-python-6.0.1 → singer-python-6.1.0}/LICENSE +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/README.md +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/setup.cfg +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/singer/__init__.py +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/singer/bookmarks.py +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/singer/catalog.py +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/singer/exceptions.py +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/singer/logger.py +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/singer/logging.conf +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/singer/metadata.py +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/singer/metrics.py +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/singer/requests.py +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/singer/schema.py +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/singer/statediff.py +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/singer/transform.py +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/singer/utils.py +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/singer_python.egg-info/SOURCES.txt +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/singer_python.egg-info/dependency_links.txt +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/singer_python.egg-info/requires.txt +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/singer_python.egg-info/top_level.txt +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/tests/__init__.py +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/tests/test_bookmarks.py +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/tests/test_catalog.py +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/tests/test_exceptions.py +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/tests/test_metadata.py +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/tests/test_metrics.py +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/tests/test_schema.py +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/tests/test_statediff.py +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/tests/test_transform.py +0 -0
- {singer-python-6.0.1 → singer-python-6.1.0}/tests/test_utils.py +0 -0
|
@@ -218,12 +218,12 @@ def parse_message(msg):
|
|
|
218
218
|
return None
|
|
219
219
|
|
|
220
220
|
|
|
221
|
-
def format_message(message):
|
|
222
|
-
return json.dumps(message.asdict(), use_decimal=True)
|
|
221
|
+
def format_message(message, ensure_ascii=True):
|
|
222
|
+
return json.dumps(message.asdict(), use_decimal=True, ensure_ascii=ensure_ascii)
|
|
223
223
|
|
|
224
224
|
|
|
225
|
-
def write_message(message):
|
|
226
|
-
sys.stdout.write(format_message(message) + '\n')
|
|
225
|
+
def write_message(message, ensure_ascii=True):
|
|
226
|
+
sys.stdout.write(format_message(message, ensure_ascii=ensure_ascii) + '\n')
|
|
227
227
|
sys.stdout.flush()
|
|
228
228
|
|
|
229
229
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import singer
|
|
2
2
|
import unittest
|
|
3
|
+
from unittest.mock import patch
|
|
3
4
|
import datetime
|
|
4
5
|
import dateutil
|
|
5
6
|
from decimal import Decimal
|
|
@@ -179,6 +180,31 @@ class TestParsingNumbers(unittest.TestCase):
|
|
|
179
180
|
value = self.create_record(value_str)
|
|
180
181
|
self.assertEqual(Decimal(value_str), value)
|
|
181
182
|
|
|
183
|
+
@patch('sys.stdout')
|
|
184
|
+
def test_ensure_ascii_false(self, mock_stdout):
|
|
185
|
+
"""
|
|
186
|
+
Setting ensure_ascii=False will preserve special characters like é
|
|
187
|
+
in their original form.
|
|
188
|
+
"""
|
|
189
|
+
rec = {"name": "José"}
|
|
190
|
+
expected_output = '{"type": "RECORD", "stream": "test_stream", "record": {"name": "José"}}\n'
|
|
191
|
+
rec_message = singer.RecordMessage(stream="test_stream", record=rec)
|
|
192
|
+
result = singer.write_message(rec_message, ensure_ascii=False)
|
|
193
|
+
mock_stdout.write.assert_called_once_with(expected_output)
|
|
194
|
+
mock_stdout.flush.assert_called_once()
|
|
195
|
+
|
|
196
|
+
@patch('sys.stdout')
|
|
197
|
+
def test_ensure_ascii_true(self, mock_stdout):
|
|
198
|
+
"""
|
|
199
|
+
ensure_ascii defaults to True, special characters like é are
|
|
200
|
+
escaped into their ASCII representation (e.g., \u00e9)
|
|
201
|
+
"""
|
|
202
|
+
rec = {"name": "José"}
|
|
203
|
+
expected_output = '{"type": "RECORD", "stream": "test_stream", "record": {"name": "Jos\\u00e9"}}\n'
|
|
204
|
+
rec_message = singer.RecordMessage(stream="test_stream", record=rec)
|
|
205
|
+
result = singer.write_message(rec_message)
|
|
206
|
+
mock_stdout.write.assert_called_once_with(expected_output)
|
|
207
|
+
mock_stdout.flush.assert_called_once()
|
|
182
208
|
|
|
183
209
|
if __name__ == '__main__':
|
|
184
210
|
unittest.main()
|
singer-python-6.0.1/PKG-INFO
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: singer-python
|
|
3
|
-
Version: 6.0.1
|
|
4
|
-
Summary: Singer.io utility library
|
|
5
|
-
Home-page: http://singer.io
|
|
6
|
-
Author: Stitch
|
|
7
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
|
8
|
-
License-File: LICENSE
|
|
9
|
-
Requires-Dist: pytz>=2018.4
|
|
10
|
-
Requires-Dist: jsonschema==2.*,>=2.6.0
|
|
11
|
-
Requires-Dist: simplejson==3.*,>=3.13.2
|
|
12
|
-
Requires-Dist: python-dateutil==2.*,>=2.7.3
|
|
13
|
-
Requires-Dist: backoff==2.*,>=2.2.1
|
|
14
|
-
Requires-Dist: ciso8601==2.*,>=2.3.1
|
|
15
|
-
Provides-Extra: dev
|
|
16
|
-
Requires-Dist: pylint; extra == "dev"
|
|
17
|
-
Requires-Dist: ipython; extra == "dev"
|
|
18
|
-
Requires-Dist: ipdb; extra == "dev"
|
|
19
|
-
Requires-Dist: nose; extra == "dev"
|
|
20
|
-
Requires-Dist: singer-tools; extra == "dev"
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: singer-python
|
|
3
|
-
Version: 6.0.1
|
|
4
|
-
Summary: Singer.io utility library
|
|
5
|
-
Home-page: http://singer.io
|
|
6
|
-
Author: Stitch
|
|
7
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
|
8
|
-
License-File: LICENSE
|
|
9
|
-
Requires-Dist: pytz>=2018.4
|
|
10
|
-
Requires-Dist: jsonschema==2.*,>=2.6.0
|
|
11
|
-
Requires-Dist: simplejson==3.*,>=3.13.2
|
|
12
|
-
Requires-Dist: python-dateutil==2.*,>=2.7.3
|
|
13
|
-
Requires-Dist: backoff==2.*,>=2.2.1
|
|
14
|
-
Requires-Dist: ciso8601==2.*,>=2.3.1
|
|
15
|
-
Provides-Extra: dev
|
|
16
|
-
Requires-Dist: pylint; extra == "dev"
|
|
17
|
-
Requires-Dist: ipython; extra == "dev"
|
|
18
|
-
Requires-Dist: ipdb; extra == "dev"
|
|
19
|
-
Requires-Dist: nose; extra == "dev"
|
|
20
|
-
Requires-Dist: singer-tools; extra == "dev"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|