mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
refactor: Migration of json utilities from core (#28522)
Co-authored-by: Eyal Ezer <eyal.ezer@ge.com>
This commit is contained in:
@@ -51,7 +51,7 @@ from superset.models.slice import Slice
|
||||
from superset.models.sql_lab import Query
|
||||
from superset.result_set import SupersetResultSet
|
||||
from superset.sql_parse import Table
|
||||
from superset.utils import core as utils
|
||||
from superset.utils import core as utils, json as json_utils
|
||||
from superset.utils.core import backend
|
||||
from superset.utils.database import get_example_database
|
||||
from superset.views.database.views import DatabaseView
|
||||
@@ -502,7 +502,7 @@ class TestCore(SupersetTestCase):
|
||||
results = SupersetResultSet(list(data), [["data"]], BaseEngineSpec)
|
||||
df = results.to_pandas_df()
|
||||
data = dataframe.df_to_records(df)
|
||||
json_str = json.dumps(data, default=utils.pessimistic_json_iso_dttm_ser)
|
||||
json_str = json.dumps(data, default=json_utils.pessimistic_json_iso_dttm_ser)
|
||||
self.assertDictEqual(
|
||||
data[0], {"data": pd.Timestamp("2017-11-18 21:53:00.219225+0100", tz=tz)}
|
||||
)
|
||||
@@ -943,7 +943,7 @@ class TestCore(SupersetTestCase):
|
||||
|
||||
encoded = json.dumps(
|
||||
{"FOO": lambda x: 1, "super": "set"},
|
||||
default=utils.pessimistic_json_iso_dttm_ser,
|
||||
default=json_utils.pessimistic_json_iso_dttm_ser,
|
||||
)
|
||||
html_string = (
|
||||
html.escape(encoded, quote=False)
|
||||
|
||||
Reference in New Issue
Block a user