Skip to content

Commit

Permalink
fix: Use utils.json_iso_dttm_ser to dump jsons when async query execu…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
cabo40 authored Apr 19, 2021
1 parent 11e0f4c commit 1448f78
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2172,7 +2172,9 @@ def results_exec( # pylint: disable=too-many-return-statements
obj = apply_display_max_row_limit(obj, rows)

return json_success(
json.dumps(obj, default=utils.json_iso_dttm_ser, ignore_nan=True)
json.dumps(
obj, default=utils.json_iso_dttm_ser, ignore_nan=True, encoding=None
)
)

@has_access_api
Expand Down

0 comments on commit 1448f78

Please sign in to comment.