uranusjr commented on code in PR #40084:
URL: https://github.com/apache/airflow/pull/40084#discussion_r1642438435


##########
airflow/dag_processing/manager.py:
##########
@@ -72,6 +72,8 @@
 
     from sqlalchemy.orm import Session
 
+logger = logging.getLogger(__name__)

Review Comment:
   Unused? I think we remove this.



##########
airflow/exceptions.py:
##########
@@ -372,14 +372,20 @@ class TaskDeferred(BaseException):
     Signal an operator moving to deferred state.
 
     Special exception raised to signal that the operator it was raised from
-    wishes to defer until a trigger fires.
+    wishes to defer until a trigger fires. Triggers can send execution back to 
task or end the task instance
+    directly. If the trigger will end the task instance itself, 
``method_name`` should be
+    None; otherwise, provide the name of the method that should be used when
+    resuming execution in the task.
     """
 
+    TRIGGER_EXIT = "__trigger_exit__"
+    """Sentinel value to signal the expectation that the trigger will exit the 
task."""
+
     def __init__(
         self,
         *,
         trigger,
-        method_name: str,
+        method_name: str = TRIGGER_EXIT,

Review Comment:
   I don’t think this needs to be a default. Callers can simply supply this 
value when appropriate, right?



##########
airflow/models/baseoperator.py:
##########
@@ -1704,15 +1704,18 @@ def defer(
         self,
         *,
         trigger: BaseTrigger,
-        method_name: str,
+        method_name: str = TaskDeferred.TRIGGER_EXIT,

Review Comment:
   Same, the default is not needed.



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