fix: Use utils.json_iso_dttm_ser to dump jsons when async query execution (#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 https://github.com/apache/superset/issues/13829

* Change to comply with tox -m pre-commit
This commit is contained in:
Carlos Fidel Selva Ochoa 2021-04-19 08:04:58 -05:00 committed by GitHub
parent 11e0f4cb2d
commit 1448f78406
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -2172,7 +2172,9 @@ class Superset(BaseSupersetView): # pylint: disable=too-many-public-methods
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