andrewgodwin commented on a change in pull request #15389:
URL: https://github.com/apache/airflow/pull/15389#discussion_r638976101



##########
File path: airflow/models/baseoperator.py
##########
@@ -1534,6 +1535,23 @@ def inherits_from_dummy_operator(self):
         # of its sub-classes (which don't inherit from anything but 
BaseOperator).
         return getattr(self, '_is_dummy', False)
 
+    def defer(
+        self,
+        *,
+        trigger: BaseTrigger,
+        method_name: str,
+        kwargs: Optional[Dict[str, Any]] = None,
+        timeout: Optional[timedelta] = None,
+    ):
+        """
+        Marks this Operator as being "deferred" - that is, suspending its
+        execution until the provided trigger fires an event.
+
+        This is achieved by raising a special exception (OperatorDeferred)
+        which is caught in the main _execute_task wrapper.
+        """
+        raise TaskDeferred(trigger=trigger, method_name=method_name, 
kwargs=kwargs, timeout=timeout)

Review comment:
       I opted against that because I wanted it to be possible to run 
everything else on 3.6 and the triggerer on 3.7.




-- 
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:
[email protected]


Reply via email to