Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] Unicode outputs being treated inconsistently in Python notebook prints? #62

Open
dxtrous opened this issue Jun 22, 2024 · 1 comment
Labels
question Further information is requested

Comments

@dxtrous
Copy link
Member

dxtrous commented Jun 22, 2024

What is your question or problem? Please describe.
When you look at the outputs of unicode strings in notebooks e.g. here https://pathway.com/developers/user-guide/connect/json_type, you will see that some unicode characters get printed directly if they go through an explicit .str conversion (like "Ł", unicode 0141, which is printed as a character), while some get escaped (like "ł" which is printed as "\u0142").

Describe what you would like to happen
I'm curious to learn if this is documented somewhere, and what is the intended behavior.

@dxtrous dxtrous added the question Further information is requested label Jun 22, 2024
@embe-pw
Copy link
Member

embe-pw commented Jun 24, 2024

The behavior is internally consistent, but possibly confusing.
What happens is that the example uses two different ways of encoding the strings – some of them are just strings and some are JSON values that are strings. str() for a string value returns it as-is, while str() for any JSON value returns its JSON representation (while trying to be ASCII-only – we could change this).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants