mirror of
https://github.com/apache/superset.git
synced 2026-04-21 00:54:44 +00:00
fix: utf-16 json encoder support (#28486)
Co-authored-by: Eyal Ezer <eyal.ezer@ge.com>
This commit is contained in:
@@ -482,7 +482,10 @@ def base_json_conv(obj: Any) -> Any:
|
||||
try:
|
||||
return obj.decode("utf-8")
|
||||
except Exception: # pylint: disable=broad-except
|
||||
return "[bytes]"
|
||||
try:
|
||||
return obj.decode("utf-16")
|
||||
except Exception: # pylint: disable=broad-except
|
||||
return "[bytes]"
|
||||
|
||||
raise TypeError(f"Unserializable object {obj} of type {type(obj)}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user