-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
SQL Lab hard fails with "'utf-8' codec can't decode byte 0xe6 in position 0: invalid continuation byte" when reading certain binary types #28372
Comments
To address the Here are the steps you can take:
This approach should help you resolve the encoding issues you're facing with binary data in Superset's SQL Lab.
|
+1 |
I don't think so, but it's possible. I was trying to allow UTF-8 strings through without them being escaped. It's possible this has to do with something being escaped incorrectly, which may or may not be the same chunk o' code. |
it seems that simplejson will handle bytes itself, and will not use logic in 'default' function: import simplejson
def convert_bytes(val):
if isinstance(val, bytes):
return 'converted-' + repr(val)
return val
print(simplejson.__version__)
# 3.17.3
print(simplejson.dumps({'a': b'b'}, default=convert_bytes))
# {"a": "b"}
print(simplejson.dumps({'a': b'\x00\x85'}, default=convert_bytes))
# raises UnicodeDecodeError so bytes should be handled before they goes into the |
Bug description
See #28001 for context
I attempted to validate the fix from #28266 but I'm still getting the same error as described in the issue.
How to reproduce the bug
Screenshots/recordings
No response
Superset version
467e612-dev
Python version
3.10
Node version
I don't know
Browser
Chrome
Additional context
Stack trace:
Also, sometimes the stack trace and error message can be slightly different. I can see this stack trace too:
Checklist
The text was updated successfully, but these errors were encountered: