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

[SQL Lab] UnicodeDecodeError when querying blob data and DB has asynchronous query execution enabled #13829

Closed
cabo40 opened this issue Mar 27, 2021 · 1 comment · Fixed by #13830
Labels
global:async-query Related to Async Queries feature sqllab Namespace | Anything related to the SQL Lab

Comments

@cabo40
Copy link
Contributor

cabo40 commented Mar 27, 2021

When a DB has asynchronous query execution enabled the json dumper doesn't honor the default parser because encoding is not None

json.dumps(obj, default=utils.json_iso_dttm_ser, ignore_nan=True)

Steps to reproduce on vanilla installation:

  1. Set sample DB to async execution in Data / Databases
  2. Query in SQL Lab the following:
select decode('DEADBEEF', 'hex');

Result:
image

@junlincc
Copy link
Member

cc @robdiciuccio

@junlincc junlincc added sqllab Namespace | Anything related to the SQL Lab global:async-query Related to Async Queries feature labels Mar 27, 2021
zhaoyongjie pushed a commit that referenced this issue Apr 19, 2021
…tion (#13830)

* Use utils.json_iso_dttm_ser to dump jsons

If encoding is not `None`, the default encoder `utils.json_iso_dttm_ser` is not used for binary data and instead tries to encode to the default 'utf-8'. 
This fixes #13829

* Change to comply with tox -m pre-commit
QAlexBall pushed a commit to QAlexBall/superset that referenced this issue Dec 29, 2021
…tion (apache#13830)

* Use utils.json_iso_dttm_ser to dump jsons

If encoding is not `None`, the default encoder `utils.json_iso_dttm_ser` is not used for binary data and instead tries to encode to the default 'utf-8'. 
This fixes apache#13829

* Change to comply with tox -m pre-commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
global:async-query Related to Async Queries feature sqllab Namespace | Anything related to the SQL Lab
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants