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


##########
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:
   Personally speaking I've typically found it easier to keep parameterization 
open since it's more flexible and we should probably not be so sure about 
future usage of `json_f`, but I am open to suggestions. Maybe we can wait for a 
second opinion?



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