Skip to content
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

Hide task duration if we don't have a start_date #47633

Merged
merged 2 commits into from
Mar 11, 2025

Conversation

jedcunningham
Copy link
Member

@jedcunningham jedcunningham commented Mar 11, 2025

In some failure scenarios, we can have an end_date without a start_date. If we naively show a duration in these cases, we end up with a negative duration, which isn't ideal. This hides the duration if we don't have start_date.

End_date wasn't added to the condition so a duration is still shown for running tasks - those with a start_date but no end_date.

Closes: #47632

With both dates:
Screenshot 2025-03-11 at 9 54 57 AM

With missing end date:
Screenshot 2025-03-11 at 9 55 05 AM

@boring-cyborg boring-cyborg bot added the area:UI Related to UI/UX. For Frontend Developers. label Mar 11, 2025
@jedcunningham jedcunningham requested a review from Copilot March 11, 2025 16:03

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modifies the task header display logic to conditionally show the duration only when a start_date is present, thereby avoiding negative duration displays when start_date is missing.

  • Wrapped the duration field in a conditional check using Boolean(taskInstance.start_date)
  • Ensures that running tasks (with a start_date) still display duration even if the end_date is missing
@jedcunningham
Copy link
Member Author

Is this true for dag runs too or only TIs?

I think just TIs.

In some failure scenarios, we can have an end_date without a start_date.
If we naively show a duration in these cases, we end up with a negative
duration, which isn't ideal. This hides the duration if we don't have
start_date.

End_date wasn't added to the condition so a duration is still shown for
running tasks - those with a start_date but no end_date.
@jedcunningham jedcunningham force-pushed the hide_duration_if_no_start_date branch from b42b0a5 to 6d6c9ae Compare March 11, 2025 19:15
@jedcunningham jedcunningham merged commit b9ab634 into apache:main Mar 11, 2025
34 checks passed
@jedcunningham jedcunningham deleted the hide_duration_if_no_start_date branch March 11, 2025 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:UI Related to UI/UX. For Frontend Developers.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't show task duration if we are missing start date
3 participants