Comments (4)
Hi @martint17r - thanks for the issue.
I'm curious why this hasn't been a problem for any other consumers of this library. I am a little concerned about the downstream effects of such a change. I suspect there is no greater issue because our target-stitch library uses the corresponding parse_message
function which is able to consume the ASCII output using json's loads
.
I'm not sure if its relevant in this case, but in the past - when PYTHONIOENCODING
was not enough - I've had to set the LANG
environment variable described in this issue docker-library/python#13.
In any case, I'd be happy to merge a PR for this change if you make the default function work as it has worked but provide a flag to use your described behavior.
from singer-python.
I believe the reason why this has not popped up anywhere else is that this is not a problem within python, i.e. the escaped unicode notation is a Python specific encoding, see 7.2 Python specific encodings, which it tolerates.
I ran into that problem, because I am trying to implement a target in Go.
According to RFC 8259 Ch. 8.1 JSON must be encoded in UTF-8, even RFC 7493 Ch. 2.1 agrees on that.
Would you accept a second pull request to PROPOSALS.md
to enhance the SPEC accordingly, i.e. define a MUST-HAVE UTF-8 encoding for all data? Something along the lines of:
"A Tap outputs structured messages to stdout in JSON format, one message per line, UTF-8 encoded".
I agree that this mandates a major version change in semver notation.
from singer-python.
This makes sense and both parts sound like a good change. I've done some preliminary testing and Python seems happy to decode both the escaped and not-escaped versions of the string.
Making it an option seems unnecessary - if you could make a PR to add the flag and we can do a major bump to 6.0.0. Adding to the Singer Spec sounds good too. Thanks for this!
(note: this SO question helped me understand the issue and there seems to be less confusion in Python 3 than 2 - the dumps
function no longer returns a string OR unicode object when this flag is present)
from singer-python.
Any update on this? For now I am using ensure_ascii=False
locally.
from singer-python.
Related Issues (20)
- Incompatible taps & targets HOT 4
- Support for inline configuration strings HOT 6
- `log_debug` cannot work...for very long HOT 3
- Bump pytz version to >= 2018.9 HOT 1
- Ratelimit helper does not support multi-threading or async
- Schema fails to be turned into dictionary if it contains "anyOf"
- 5.9.0: Transformer.filter_data_by_metadata() doesn't filter unselected nodes where selected unspecified HOT 1
- Feature Request: Add support for --stream_name argument HOT 1
- Messages are not valid JSON
- Transformer dumps JSON incompatible string
- Async support
- JSONSchema Draft 7 array Tuple Validation unsupported? Schema.from_dict() raise exception HOT 1
- Add UTF-8 validity checking to schema
- Support Draft 7 validation keys in object schemas
- --catalog vs -p (properties) parameters HOT 4
- Loosen version spec in setup.py HOT 4
- `utils.strptime` and `utils.strftime` are asymmetrical HOT 7
- use singer taps and targets programatically HOT 5
- Invalid format string %04Y on Windows HOT 8
- Is requirement for backoff==1.3.2 necessary HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from singer-python.