potiuk commented on code in PR #48007:
URL: https://github.com/apache/airflow/pull/48007#discussion_r2008748894
##########
airflow/utils/json.py:
##########
@@ -18,70 +18,9 @@
from __future__ import annotations
import json
-from datetime import date, datetime
-from decimal import Decimal
from typing import Any
-from flask.json.provider import JSONProvider
-
-from airflow.serialization.serde import CLASSNAME, DATA, SCHEMA_ID,
deserialize, serialize
-from airflow.utils.timezone import convert_to_utc, is_naive
-
-
-class AirflowJsonProvider(JSONProvider):
- """JSON Provider for Flask app to use WebEncoder."""
-
- ensure_ascii: bool = True
- sort_keys: bool = True
-
- def dumps(self, obj, **kwargs):
- kwargs.setdefault("ensure_ascii", self.ensure_ascii)
- kwargs.setdefault("sort_keys", self.sort_keys)
- return json.dumps(obj, **kwargs, cls=WebEncoder)
-
- def loads(self, s: str | bytes, **kwargs):
- return json.loads(s, **kwargs)
-
-
-class WebEncoder(json.JSONEncoder):
Review Comment:
Nice.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]