You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/08/02 15:22:21 UTC

[GitHub] [airflow] ephraimbuddy commented on a diff in pull request #25471: Fix Serialization error in TaskCallbackRequest

ephraimbuddy commented on code in PR #25471:
URL: https://github.com/apache/airflow/pull/25471#discussion_r935730738


##########
airflow/callbacks/callback_requests.py:
##########
@@ -74,8 +75,8 @@ def __init__(
         self.is_failure_callback = is_failure_callback
 
     def to_json(self) -> str:
-        dict_obj = self.__dict__.copy()
-        dict_obj["simple_task_instance"] = dict_obj["simple_task_instance"].__dict__
+        dict_obj = copy.deepcopy(self.__dict__)

Review Comment:
   I changed to `self.simple_task_instance.as_dict()` and it solved the issue I was having before that made me use deepcopy. Previously with just copy, my test was not passing as input != result.
   Thanks



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org