Fix Gantt tooltip showing wrong end date on queued/scheduled bars - #68570
Conversation
The tooltip on the queued and scheduled segments of a Gantt bar reported the end of that segment (e.g. the moment queueing ended) as the task's End Date, instead of the task's actual end. This was a regression from the start-date fix in apache#68176, which made the Start Date consistent across segments but left the End Date per-segment. Carry the task's effective end (end_date, or "now" while running) on every segment of a try as `end_when`, mirroring `start_when`, and use it for the tooltip's End Date so all segments of a try report the same start and end. closes: apache#68174
|
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
|
|
can you share before/after images? |
@eladkal Pls find attached the screenshots. |
|
Hi @eladkal , any update on this? |
pierrejeambrun
left a comment
There was a problem hiding this comment.
Thanks @Aaryan123456679 — fix mirrors the existing start_when plumbing cleanly and the screenshots make the win obvious. One small nit on the new running-task test below.
pierrejeambrun
left a comment
There was a problem hiding this comment.
One more thing on top of the test nit — the new end_when line is asymmetric with start_when in two ways that I think can be smoothed out together.
Address review: derive a single effectiveEndDate (the raw end_date, or "now" while a started task is still running) and gate end_when on it the same way start_when is gated on start_date. Finished tasks now keep the API's raw end_date string instead of a re-serialized dayjs timestamp, and the tryWhenForTooltip block no longer depends on endMs ordering. Pin the running-task test to a fixed "now" via fake timers.
pierrejeambrun
left a comment
There was a problem hiding this comment.
LGTM, just one nit to address (remove the noisy comments)
Address review: drop the verbose inline comments around effectiveEndDate and tryWhenForTooltip; the code is self-explanatory.
choo121600
left a comment
There was a problem hiding this comment.
looks good,
Thanks for the contribution :)
Let's wait for CI to go green.


The Gantt tooltip showed the wrong End Date when hovering over the queued or scheduled segment of a task bar: it reported the end of that segment (e.g. the instant queueing ended) rather than the task's actual end.
This was a regression from #68176, which fixed the Start Date by carrying the task's real
start_dateon every segment of a try (start_when) but left the End Date derived from each segment's own bounds (max_end_date = segment.x[1]).This PR mirrors that approach for the end: each segment of a try now carries the task's effective end (
end_date, or "now" while the task is still running) asend_when, and the tooltip uses it for the End Date. As a result, the scheduled, queued, and execution bars of the same try all report a consistent Start Date, End Date, and duration.Tests added in
Gantt/utils.test.tsassert thatstart_when/end_whenare carried consistently across all segments of a finished task and of a running task.closes: #68174
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 4.8) following the guidelines