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


##########
airflow/dag_processing/manager.py:
##########
@@ -580,6 +580,7 @@ def _run_parsing_loop(self):
                     pass
                 elif isinstance(agent_signal, CallbackRequest):
                     self._add_callback_to_queue(agent_signal)
+                    self.log.debug("_add_callback_to_queue; agent signal; %s", 
agent_signal)

Review Comment:
   It was more of for debugging purpose.



##########
airflow/dag_processing/processor.py:
##########
@@ -796,8 +818,16 @@ def _execute_task_callbacks(self, dagbag: DagBag | None, 
request: TaskCallbackRe
         if task:
             ti.refresh_from_task(task)
 
-        ti.handle_failure(error=request.msg, test_mode=self.UNIT_TEST_MODE, 
session=session)
-        self.log.info("Executed failure callback for %s in state %s", ti, 
ti.state)
+        if callback_type is TaskInstanceState.SUCCESS:
+            context = ti.get_template_context(session=session)
+            if not ti.task:
+                return

Review Comment:
   Changed it



##########
airflow/triggers/temporal.py:
##########
@@ -34,9 +34,13 @@ class DateTimeTrigger(BaseTrigger):
     a few seconds.
 
     The provided datetime MUST be in UTC.
+
+    :param moment: when to yield event
+    :param end_task: whether the trigger should mark the task successful after 
time condition
+        reached or resume the task after time condition reached.
     """
 
-    def __init__(self, moment: datetime.datetime):
+    def __init__(self, moment: datetime.datetime, *, end_task=False):

Review Comment:
   Added.



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

Review Comment:
   Added it



##########
airflow/sensors/date_time.py:
##########
@@ -90,13 +91,8 @@ class DateTimeSensorAsync(DateTimeSensor):
     def __init__(self, **kwargs) -> None:
         super().__init__(**kwargs)
 
-    def execute(self, context: Context) -> NoReturn:
-        trigger = DateTimeTrigger(moment=timezone.parse(self.target_time))
+    def execute(self, context: Context) -> None:

Review Comment:
   Changed it



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