From 1448f7840643c8edb0ff1f1f94437e776c740ca3 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 af2cabe669..95ba394b34 100755 --- a/superset/views/core.py +++ b/superset/views/core.py @@ -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