Repository navigation
Conversation
cb0a135 to
48872f8
Compare
|
Thanks for opening this. Let's make sure dags list performance issues are resolved first. Like in this PR: #69806. Only after that should we add any more complexity to the dags list |
Makes sense, thanks. I'll take a look at the dags list performance work too and see if there's anything I can help with there. |
2972d54 to
fc551db
Compare
pierrejeambrun
left a comment
There was a problem hiding this comment.
Can you benchmark this when there are millions of TI and hundred of thousand of runs in the DB?
I would like to double check performance, my feeling is that it will not scale way because of the subqueries
|
Let's just have it always be one line. I'd rather not maintain logic saying, "if this dag isnt running, then let it be two lines" that sounds very easy to mess up and break. |
|
I opened the single-line change for the existing columns separately in #74002, since it felt a bit different in scope from this PR. With that applied and the latest run tasks also kept on one line, the table could look like this. Option 1 (only the states present in the run) Screen.Recording.2026-10-01.at.8.14.28.PM.movKeeping everything on one line reminded me of Airflow 2, so I also tried listing every state in a fixed position the way Airflow 2 did, with the empty ones dimmed. Personally, I don't think it looks as good. Option 2 (every state)
I'll go ahead with |
|
Thanks @pedro-cf! About the icons, as far as I know the state badge hasn't been used without its icon since it was introduced, so it has been used much like a standard across the UI. If we dropped the icons only here, I wonder if this column would feel a bit out of tone with the rest of the UI. About the description, I couldn't find a precedent for one on a table column header, but I'll give it a try. |
|
Thank you very much for your wonderful work @yuseok89
Regarding this, my concern is whether you are displaying only the tasks from the "Latest Run", rather than the "status of tasks from all active DAG Runs or, if not currently active, from the most recent run." If so, would it be possible to change it to the latter? |
|
Thanks for clarifying! |
…ist-latest-run-ti-state-counts
…ist-latest-run-ti-state-counts
a7c3770 to
25130a5
Compare
# Conflicts: # airflow-core/src/airflow/ui/openapi-gen/requests/services.gen.ts # airflow-core/src/airflow/ui/src/constants/localStorage.ts # airflow-core/src/airflow/ui/src/pages/Settings/Settings.test.tsx # airflow-core/src/airflow/ui/src/pages/Settings/Settings.tsx
|
Hi @bbovenzi @pedro-cf, I've addressed the feedback so far.
Could you take another look when you have a moment? |
…ist-latest-run-ti-state-counts # Conflicts: # airflow-core/src/airflow/ui/src/pages/DagsList/DagsList.test.tsx # airflow-core/src/airflow/ui/src/pages/DagsList/DagsList.tsx
|
Resolved the conflicts with main. After resolving them, |
|
Thanks @bbovenzi @pierrejeambrun @pedro-cf for the reviews. Your feedback helped me get this to a much better place than where it started, and I learned a lot along the way. |


closes: #66947
Each Dag card and table row on the Dags list now shows the task instance states of the Dag's recent runs as clickable badges, like the "Recent Tasks" column in Airflow 2. The counts cover all running Dag runs, or the most recent run when none is running. Clicking a badge opens the task instance list filtered to those runs and that state.
What changed
GET /ui/dags/recent_task_instance_state_counts. It takes the latest run ids the Dag list already returns (dag_run_ids, bounded by the API max page limit) and counts, in one statement, the task instances of each Dag's running runs, or of that latest run when none is running. Each entry returns the countedrun_idsand thestate_counts.no_status.Unlike the run state badges from #67242, which count a Dag's runs by state, these count the task instances of its recent runs.
Query performance
The counts come from a single statement whose size does not grow with the number of running runs. Running runs are found through the partial
idx_dag_run_running_dagsindex and their task instances throughti_dag_run, so the cost scales with the task instances actually counted. In a local benchmark (postgres 14, Airflow's indexes, 100 Dags × 1,050 runs × 30 tasks), it was roughly 40 to 75 times faster than counting with one UNION ALL branch per run once Dags had 50 running runs each. Absolute timings depend on the machine.Demo
Screen.Recording.2026-10-05.at.10.06.37.PM.mov
Was generative AI tooling used to co-author this PR?
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.