uranusjr commented on code in PR #32385:
URL: https://github.com/apache/airflow/pull/32385#discussion_r1253948072


##########
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:
   I think we should always use WebEncoder here, so the extra argument is not 
needed.
   
   Right now `json_f` is actually only used once, but since `json_f` is only 
for the web UI, all usages in the future should use WebEncoder anyway.



-- 
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]

Reply via email to