refactor: Migration of json utilities from core (#28522)

Co-authored-by: Eyal Ezer <eyal.ezer@ge.com>
This commit is contained in:
Eyal Ezer
2024-05-20 12:27:22 -05:00
committed by GitHub
parent e954360eec
commit 56f0fc4ec2
30 changed files with 431 additions and 316 deletions

View File

@@ -14,7 +14,6 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
import json
from typing import Callable
from flask import abort, request
@@ -25,7 +24,7 @@ from flask_wtf.csrf import same_origin
from superset import event_logger, is_feature_enabled
from superset.daos.dashboard import EmbeddedDashboardDAO
from superset.superset_typing import FlaskResponse
from superset.utils import core as utils
from superset.utils import json as json_utils
from superset.views.base import BaseSupersetView, common_bootstrap_payload
@@ -87,7 +86,7 @@ class EmbeddedView(BaseSupersetView):
return self.render_template(
"superset/spa.html",
entry="embedded",
bootstrap_data=json.dumps(
bootstrap_data, default=utils.pessimistic_json_iso_dttm_ser
bootstrap_data=json_utils.dumps(
bootstrap_data, default=json_utils.pessimistic_json_iso_dttm_ser
),
)