wiasliaw opened a new pull request, #73555: URL: https://github.com/apache/airflow/pull/73555
## TL;DR Add time range filtering to the Gantt view. Since the Gantt started showing all task tries (#61058), clearing a run long after it first ran stretches the time window to cover every historical try — a run cleared a week later gets a week-wide axis, and second-long tasks are crushed to the minimum bar width. Because there is no way to tell which `TaskInstanceHistory` row belongs to which clear, a per-clear selector is not possible; a time range filter lets users zoom into the window they care about instead. related: #63715 <img width="321" height="424" alt="image" src="https://github.com/user-attachments/assets/a0d297a3-163f-4f24-b663-302a9df77690" /> <img width="612" height="612" alt="image" src="https://github.com/user-attachments/assets/4ce83089-6813-4935-99b4-1c3129680f98" /> <img width="603" height="611" alt="image" src="https://github.com/user-attachments/assets/acdc2fb2-3d26-472b-9c7e-83ead79d47d0" /> ## Changes - **Backend**: `GET /ui/gantt/{dag_id}/{run_id}` gains `start_date_gte|gt|lte|lt` and `end_date_gte|gt|lte|lt` query parameters, filtering both `TaskInstance` and `TaskInstanceHistory`. Filtering happens entirely in the backend, per the review feedback on #64387. - **NULL semantics**: a running task (NULL `end_date`) passes upper-bound filters; a queued/scheduled task (NULL `start_date`) passes lower-bound filters, so in-flight work is never dropped. - **404 vs 200**: 404 only when the run does not exist; a run that exists but is fully filtered out returns 200 with an empty list. - **Frontend**: reuses the existing `DateRangeFilter` pills in the shared FilterBar (shown only in the Gantt view) with full datetime precision, and passes the range through as query parameters — no client-side filtering. - **Tests**: 27 backend tests in `test_gantt.py`; 24 frontend tests in `Gantt.test.tsx` / `GridFilters.test.tsx`. ## Note **Known limitation**: mapped-task and task-group aggregate bars are built from the grid TI summaries stream, which the time window does not touch, so they stay visible even when every underlying try falls outside the window. Closing that gap requires window-filtered aggregate rows from the backend and is left to a follow-up. --- ##### Was generative AI tooling used to co-author this PR? - [x] Yes Generated-by: [Claude Fable 5] following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- 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]
