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


##########
airflow/sensors/base.py:
##########
@@ -82,6 +88,29 @@ def __bool__(self) -> bool:
         return self.is_done
 
 
+@internal_api_call
+@provide_session
+def _orig_start_date(dag_id, task_id, run_id, map_index, try_number, session: 
Session = NEW_SESSION):
+    """
+    Get the original start_date for a rescheduled task.
+
+    :meta private:
+    """
+    return session.scalar(
+        select(TaskReschedule)
+        .where(
+            TaskReschedule.dag_id == dag_id,
+            TaskReschedule.task_id == task_id,
+            TaskReschedule.run_id == run_id,
+            TaskReschedule.map_index == map_index,
+            TaskReschedule.try_number == try_number,
+        )
+        .order_by(asc(TaskReschedule.id))

Review Comment:
   Just a note that importing `asc` is not strictly needed (because SQL) and if 
you want to be explicit `TaskReschedule.id.asc()` is possible. But this is also 
not wrong.



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