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 2021/05/13 14:28:42 UTC

[GitHub] [airflow] ashb commented on a change in pull request #15821: Refactor out callback isinstance() checks

ashb commented on a change in pull request #15821:
URL: https://github.com/apache/airflow/pull/15821#discussion_r631852197



##########
File path: airflow/utils/callback_requests.py
##########
@@ -41,8 +54,12 @@ def __eq__(self, other):
     def __repr__(self):
         return str(self.__dict__)
 
+    def execute(self, dagbag: "DagBag", *, session: Session) -> None:
+        """Execute the callback."""
+        raise NotImplementedError("implement in subclass")
+
 
-class TaskCallbackRequest(CallbackRequest):
+class TaskCallbackRequest(CallbackRequest, LoggingMixin):

Review comment:
       This is _probably_ safe, but these objects are passed over a multiprocessing Pipe, so are subject to pickling, so we should create a `__getstate__`(?) method to ensure that `self.log` is never attempted to be pickled. 




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

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