You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add a time range selector for the Gantt view #63715
Since we enabled the Gantt to show All task tries: #61058 this has some side effects.
I agree that this can feel confusing and that this prevent having a precise representation of task duration for a specific 'run/clear/tries set'. This is the expected behavior though and a side effect of showing all tries, converting this into a feature request
What happens:
If I have a run with TI running in ~ a few minutes. And after a week, I want to clear the run. Then the Gantt chart time window will be a week, to be able to display tries 1 and tries 2 of each TI. Since tasks execution time is really small compare to the Gantt time window (1 week) virtually this will force all TIs and TIHs to have the smallest width possible, making this impossible to dissociate long running from short running tasks. This problem will happen for every dag and every run if we wait long enough between the initial run and the clear action.
We do not know which TIH belongs to which clear, so it's no possible to introduce a selector there.
I thought about maybe we could simply add a flag such as 'Show TaskInstance History' checkbox so we could decide whether or not we want to see historical TI in the Gantt (possibly crushing the durations) or if we should only show the latest tries which will belong to the same Run (most likely). That's basically a checkbox for enablinghttps://github.com/apache/airflow/pull/61058, by default True. The problem is that we could still have the same behavior if we clear a single TI manually.
Suggestion
So maybe we should simply add a start date/end date range filter in the Gantt endpoint/UI so we can 'zoom in/out' on specific parts of the Gantt chart to be able to have a more precise representation if needed.
A time range selector in the Gantt view would be useful from an operational troubleshooting perspective. In production environments, users often review DAG runs after retries, clears, reruns, or delayed task executions, and being able to narrow the displayed time window would make it easier to understand task duration, overlaps, and execution sequencing.
This could also help platform and support teams analyze long-running workflows without visually scanning the entire timeline. A focused time range filter would improve usability, especially for DAGs with many tasks or complex dependency chains.
I would be interested in helping with this if maintainers think it is suitable for a first UI contribution.
I'll review the contribution guidelines and take a closer look at the implementation details to determine whether I can put together a suitable PR for this enhancement.
Working on this: adding a datetime range FilterBar control for Gantt that passes start_date_gte / end_date_lte to GET /ui/gantt/{dag_id}/{run_id} with server-side overlap filtering (including NULL start/end for queued/running tasks) and clamping the Gantt axis to the selected window. Opening a PR this week. Taking the review feedback from #64387 into account (reuse DateRangeFilter, full datetime precision, no filters inside the chart layout box).
I'd like to confirm the intended filter semantics. There are two possible shapes:
A single time window [from, to]: the "zoom" reading of this issue. The chart shows every task instance that overlaps the window: start_date <= to AND (end_date >= from OR end_date IS NULL). Note the mapping is crossed: the window's from bounds the task's end_date, and the window's to bounds the task's start_date. This matches the two-parameter shape Add date range filter to Gantt view #64387 used (start_date / end_date as onewindow).
Two per-field range filters: a Start Date [gte, lte] range and an End Date [gte, lte] range, following the existing Grid filter convention (each pill filters one field). More expressive (e.g. "tasks that ended during an incident window"), but to zoom the user has to work out the crossed mapping themselves, which seems wrong for the use case described here. (My PR is implemented based on option 2.)
Two questions:
should the UI expose a single time-window filter (option 1), or per-field ranges (option 2)?
When a window is active, should the Gantt x-axis clamp exactly to [from, to], or to the min/max of the filtered bars (a partially overlapping bar would then stretch the axis beyond the window)?
I’ve opened this PR to finally close out #63715. Before writing a single line of code, I spent time auditing the previous attempts at this (#61058) and specifically took your feedback into account to ensure this doesn't become another closed PR.
I wanted to hand you a complete, production-ready package that eases your review burden. Here is how this implementation guarantees we don't hit the performance pitfalls of the previous attempts:
Zero Client-Side Bloat: We are no longer trying to fetch every task instance and filter it in React. This is a pure server-side implementation, meaning Gantt charts for massive DAGs will stay snappy and won't OOM the browser.
Strict Index Preservation: I noticed a previous attempt used COALESCE(end_date, NOW()) which destroys index utilization and forces full table scans. I explicitly avoided this. The SQL logic here uses or_(TaskInstance.end_date >= start_date_gte, TaskInstance.end_date.is_(None)). This ensures running/queued tasks still render perfectly while keeping the database execution plan optimized.
Clean OpenAPI Pipeline: I've wired this seamlessly through GridFilters.tsx and updated the gantt.py endpoint. I intentionally avoided committing fragile manual patches to openapi-gen/; the CI's openapi-merge-cli pipeline will automatically pick up the new types.
This should be a clean, low-risk drop-in that significantly improves the UX for large DAG executions. Looking forward to your thoughts!
Activity
pierrejeambrun commentedon Mar 16, 2026
More information on this.
Since we enabled the Gantt to show All task tries: #61058 this has some side effects.
I agree that this can feel confusing and that this prevent having a precise representation of task duration for a specific 'run/clear/tries set'. This is the expected behavior though and a side effect of showing all tries, converting this into a feature request
What happens:
If I have a run with TI running in ~ a few minutes. And after a week, I want to clear the run. Then the Gantt chart
time windowwill be a week, to be able to display tries 1 and tries 2 of each TI. Since tasks execution time is really small compare to the Gantt time window (1 week) virtually this will force all TIs and TIHs to have the smallest width possible, making this impossible to dissociate long running from short running tasks. This problem will happen for every dag and every run if we wait long enough between the initial run and the clear action.We do not know which TIH belongs to which
clear, so it's no possible to introduce a selector there.I thought about maybe we could simply add a flag such as 'Show TaskInstance History' checkbox so we could decide whether or not we want to see historical TI in the Gantt (possibly crushing the durations) or if we should only show the latest tries which will belong to the same Run (most likely). That's basically a checkbox for enabling
https://github.com/apache/airflow/pull/61058, by default True. The problem is that we could still have the same behavior if we clear a single TI manually.Suggestion
So maybe we should simply add a
start date/end daterange filter in the Gantt endpoint/UI so we can 'zoom in/out' on specific parts of the Gantt chart to be able to have a more precise representation if needed.20 remaining items
venkatamandavilli-code commentedon Jun 16, 2026
Thanks for raising this enhancement.
A time range selector in the Gantt view would be useful from an operational troubleshooting perspective. In production environments, users often review DAG runs after retries, clears, reruns, or delayed task executions, and being able to narrow the displayed time window would make it easier to understand task duration, overlaps, and execution sequencing.
This could also help platform and support teams analyze long-running workflows without visually scanning the entire timeline. A focused time range filter would improve usability, especially for DAGs with many tasks or complex dependency chains.
I would be interested in helping with this if maintainers think it is suitable for a first UI contribution.
pierrejeambrun commentedon Jun 19, 2026
@venkatamandavilli-code Please go ahead, feel free to open a PR. Be sure to check our guidelines for contribution. (tools, AI assited PR, etc...)
venkatamandavilli-code commentedon Jun 19, 2026
@pierrejeambrun,
Thank you for the encouragement and guidance.
I'll review the contribution guidelines and take a closer look at the implementation details to determine whether I can put together a suitable PR for this enhancement.
ashutosh264 commentedon Aug 7, 2026
Working on this: adding a datetime range FilterBar control for Gantt that passes start_date_gte / end_date_lte to GET /ui/gantt/{dag_id}/{run_id} with server-side overlap filtering (including NULL start/end for queued/running tasks) and clamping the Gantt axis to the selected window. Opening a PR this week. Taking the review feedback from #64387 into account (reuse DateRangeFilter, full datetime precision, no filters inside the chart layout box).
wiasliaw commentedon Sep 22, 2026
I'd like to confirm the intended filter semantics. There are two possible shapes:
A single time window
[from, to]: the "zoom" reading of this issue. The chart shows every task instance that overlaps the window:start_date <= to AND (end_date >= from OR end_date IS NULL). Note the mapping is crossed: the window's from bounds the task's end_date, and the window's to bounds the task's start_date. This matches the two-parameter shape Add date range filter to Gantt view #64387 used (start_date/end_dateas onewindow).Two per-field range filters: a Start Date
[gte, lte]range and an End Date[gte, lte]range, following the existing Grid filter convention (each pill filters one field). More expressive (e.g. "tasks that ended during an incident window"), but to zoom the user has to work out the crossed mapping themselves, which seems wrong for the use case described here. (My PR is implemented based on option 2.)Two questions:
[from, to], or to the min/max of the filtered bars (a partially overlapping bar would then stretch the axis beyond the window)?Drafted-by: Claude Code (Fable 5)
jhaabhijeet864 commentedon Oct 1, 2026
Hi @bbovenzi @pierrejeambrun @potiuk (and team),
I’ve opened this PR to finally close out #63715. Before writing a single line of code, I spent time auditing the previous attempts at this (#61058) and specifically took your feedback into account to ensure this doesn't become another closed PR.
I wanted to hand you a complete, production-ready package that eases your review burden. Here is how this implementation guarantees we don't hit the performance pitfalls of the previous attempts:
COALESCE(end_date, NOW())which destroys index utilization and forces full table scans. I explicitly avoided this. The SQL logic here usesor_(TaskInstance.end_date >= start_date_gte, TaskInstance.end_date.is_(None)). This ensures running/queued tasks still render perfectly while keeping the database execution plan optimized.GridFilters.tsxand updated thegantt.pyendpoint. I intentionally avoided committing fragile manual patches toopenapi-gen/; the CI'sopenapi-merge-clipipeline will automatically pick up the new types.This should be a clean, low-risk drop-in that significantly improves the UX for large DAG executions. Looking forward to your thoughts!
feat: Add time range filter to Gantt view (apache#63715)
Apply Gantt date filters to mapped tasks and task groups (#75725)
Apply Gantt date filters to mapped tasks and task groups (#75725) (#7…
Apply Gantt date filters to mapped tasks and task groups (#75725) (#7…