amoghrajesh commented on code in PR #61394:
URL: https://github.com/apache/airflow/pull/61394#discussion_r2780975242


##########
task-sdk/src/airflow/sdk/execution_time/task_runner.py:
##########
@@ -957,13 +957,35 @@ def sort_dict_recursively(obj: Any) -> Any:
             return tuple(sort_dict_recursively(item) for item in obj)
         return obj
 
+    def to_serializable(obj: Any) -> Any:
+        """Convert objects to JSON serializable types."""
+        if obj is None or isinstance(obj, (str, int, float, bool)):
+            return obj
+
+        if isinstance(obj, dict):
+            return {k: to_serializable(v) for k, v in obj.items()}
+
+        if isinstance(obj, (list, tuple)):
+            return [to_serializable(item) for item in obj]
+
+        # Some objects like Kubernetes ones or boto3 ones have to_dict 
defined, try using them if they exist
+        if hasattr(obj, "to_dict"):
+            return obj.to_dict()
+
+        return obj

Review Comment:
   Just pushed a change to handle that: 1c9304ad2e



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