-
Notifications
You must be signed in to change notification settings - Fork 16.3k
UI: add task instance summary to DAG cards #60105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before any more dev work. Please provide:
- a screenshot of a dag card with every state badge at once.
- also do a manual test of the dags page with many example dags that have run, at least one with 1000 tasks (This is a good use for an AI tool, have it generate a bunch of large dags for you to test against)
airflow-core/src/airflow/ui/src/pages/DagsList/TaskInstanceSummary.tsx
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/ui/src/pages/DagsList/TaskInstanceSummary.tsx
Outdated
Show resolved
Hide resolved
|
Hi @bbovenzi, |
02e63a8 to
445f9a8
Compare
Again, we need a fastapi update to support this. Fetching 1000 task instances for every dag on the dags list page will affect the performance too much to be acceptable for users. You can look at our dags with runs endpoint in |
Thanks for the clarification — that makes sense. |
|
Hi @bbovenzi, |
|
Can you please do a little bit of manual testing? I am not your AI prompt writer.
|
Thanks for the feedback @bbovenzi — I’ve addressed all the points raised:
|
jason810496
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. The overall API changes and the test scenarios LGTM.
airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/dags.py
Outdated
Show resolved
Hide resolved
- Add SQL query to compute task instance counts by state for the latest DAG run (using window function) - Add task_instance_summary field to DAGWithLatestDagRunsResponse - Simplify TaskInstanceSummary component to use pre-computed data - Update DagCard to pass task_instance_summary prop - Update tests to reflect new API structure This addresses reviewer feedback to aggregate task instance stats in SQL rather than fetching individual task instances.
Tests cover: - Aggregated task instance counts by state - Only latest DAG run is included in summary - Empty summary when no task instances exist
- Fix query to use composite key (dag_id, run_id) instead of non-existent dag_run_id - Update tests to use raw SQL inserts for TaskInstance creation - Remove unused TYPE_CHECKING import
…tRunStats model - Add new LatestRunStats Pydantic model with task_instance_counts field - Rename field from task_instance_summary to latest_run_stats - Update backend response construction to use LatestRunStats model - Update OpenAPI spec with new schema - Update TypeScript types and schemas - Update UI components (DagCard, TaskInstanceSummary) - Update backend and frontend tests Addresses reviewer feedback from @jason810496
1f665f7 to
066f5ce
Compare
jason810496
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update!
airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/dags.py
Outdated
Show resolved
Hide resolved
…gs.py Co-authored-by: Jason(Zhe-You) Liu <68415893+jason810496@users.noreply.github.com>
What does this PR do?
Adds a compact Task Instance summary to DAG cards on the DAG list page,
showing task state counts for the most recent DagRun.
This helps operators quickly identify DAGs that need attention and restores
at-a-glance operational visibility similar to what existed in Airflow 2.
How was this implemented?
Testing
This is a UI-only change. I was not able to fully run the Airflow UI locally,
but the implementation follows existing DagCard patterns and relies on
existing APIs. CI should validate the build and types.
Related issue
Fixes #50624