From a61bf28a3d16ac5b50624f6d5a5d2a7f55ca929e Mon Sep 17 00:00:00 2001 From: Carlos Fidel Selva Ochoa Date: Mon, 19 Apr 2021 08:04:58 -0500 Subject: [PATCH] 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 --- superset/views/core.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/superset/views/core.py b/superset/views/core.py index af2cabe669b52..95ba394b346c8 100755 --- a/superset/views/core.py +++ b/superset/views/core.py @@ -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