hkc-8010 commented on code in PR #68012:
URL: https://github.com/apache/airflow/pull/68012#discussion_r3524391340
##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py:
##########
@@ -296,6 +296,11 @@ def ti_run(
)
or 0
)
+ first_task_reschedule_start_date = None
+ if task_reschedule_count > 0:
+ first_task_reschedule_start_date = session.scalar(
+
select(func.min(TaskReschedule.start_date)).where(TaskReschedule.ti_id ==
task_instance_id)
+ )
Review Comment:
Good suggestion. Implemented in `1b6042916e3`.
I combined the `TaskReschedule` count and earliest `start_date` lookup into
a single aggregate query, so the run path now keeps the same behavior with one
DB round trip instead of two. I also updated the regression test to insert the
later row first, which verifies we return the earliest timestamp rather than
depending on insertion order.
--
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]