This is an automated email from the ASF dual-hosted git repository.
yongjiezhao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new 1448f78 fix: Use utils.json_iso_dttm_ser to dump jsons when async
query execution (#13830)
1448f78 is described below
commit 1448f7840643c8edb0ff1f1f94437e776c740ca3
Author: Carlos Fidel Selva Ochoa <[email protected]>
AuthorDate: Mon Apr 19 08:04:58 2021 -0500
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 af2cabe..95ba394 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