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 15:36:04 UTC

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

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



##########
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:
       Alternatively I can pass in the logger instance as an argument of `execute()` instead? I don’t really like making CallbackRequest instances subclass from `LoggingMixin` tbh, but passing a logger around also feels a bit weird.




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