hussein-awala commented on code in PR #28777:
URL: https://github.com/apache/airflow/pull/28777#discussion_r1064173784


##########
airflow/www/utils.py:
##########
@@ -133,13 +133,25 @@ def get_mapped_summary(parent_instance, task_instances):
 
 
 def get_dag_run_conf(dag_run_conf: Any) -> tuple[str | None, bool]:
+    class DagRunConfEncoder(json.JSONEncoder):
+        def default(self, obj):
+            if isinstance(obj, bytes):
+                try:
+                    return obj.decode()
+                except Exception:
+                    return str(obj)
+            try:
+                return json.JSONEncoder.default(self, obj)
+            except Exception:
+                return str(obj)

Review Comment:
   This method is only used to show dag run conf dictionary content in Airflow 
Webserver, but the same content is stored in the database as `PickleType` 
without any type conversion, and it read and deserialized when we call 
`dag_run.conf`.
   As long as there are no problems with handling the different types in the 
conf dict, I think converting binary types to str can solve the UI problem.



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