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


##########
airflow/sensors/time_sensor.py:
##########
@@ -72,13 +73,8 @@ def __init__(self, *, target_time: datetime.time, **kwargs) 
-> None:
 
         self.target_datetime = timezone.convert_to_utc(aware_time)
 
-    def execute(self, context: Context) -> NoReturn:
-        trigger = DateTimeTrigger(moment=self.target_datetime)
+    def execute(self, context: Context) -> None:
         self.defer(
-            trigger=trigger,
-            method_name="execute_complete",
+            method_name=TaskDeferred.TRIGGER_EXIT,
+            trigger=DateTimeTrigger(moment=self.target_datetime, 
end_task=True),

Review Comment:
   I have removed `TaskDeferred.TRIGGER_EXIT` as it was sentinel value to 
signal the expectation that the trigger will exit the task. If the trigger will 
terminate the task instance itself, `method_name` should be None. Otherwise, 
provide the name of the method to be used when resuming execution in the task.



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