xuganyu96 commented on code in PR #32385:
URL: https://github.com/apache/airflow/pull/32385#discussion_r1254931127
##########
airflow/www/utils.py:
##########
@@ -476,12 +476,12 @@ def datetime_html(dttm: DateTime | None) -> str:
return Markup('<nobr><time title=""
datetime="{}">{}</time></nobr>').format(as_iso, as_iso_short)
-def json_f(attr_name):
+def json_f(attr_name, json_encoder: type[json.JSONEncoder] = json.JSONEncoder):
"""Returns a formatted string with HTML for given JSON serializable."""
def json_(attr):
f = attr.get(attr_name)
- serialized = json.dumps(f)
+ serialized = json.dumps(f, cls=json_encoder)
Review Comment:
@uranusjr I've updated the code so that `json_f` always uses `WebEncoder`
and updated the relevant func calls + unit tests. Please review at your
convenience. Thank you!
--
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]