Prab-27 commented on code in PR #59918:
URL: https://github.com/apache/airflow/pull/59918#discussion_r2700693841
##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -2432,19 +2432,23 @@ def _get_num_times_stuck_in_queued(self, ti:
TaskInstance, session: Session = NE
.limit(1)
)
- query = session.query(Log).where(
- Log.task_id == ti.task_id,
- Log.dag_id == ti.dag_id,
- Log.run_id == ti.run_id,
- Log.map_index == ti.map_index,
- Log.try_number == ti.try_number,
- Log.event == TASK_STUCK_IN_QUEUED_RESCHEDULE_EVENT,
+ statement = (
+ select(func.count())
+ .select_from(Log)
Review Comment:
Yes, you are right! This is the simplest and best approach.
Thanks a lot, I learned a lot from this discussion.
--
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]