Skip to content

Commit b42b0a5

Browse files
committed
Hide task duration if we don't have a start_date
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.
1 parent 5dae3b5 commit b42b0a5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

airflow/ui/src/pages/TaskInstance/Header.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ export const Header = ({
4646
...(taskInstance.try_number > 1 ? [{ label: "Try Number", value: taskInstance.try_number }] : []),
4747
{ label: "Start", value: <Time datetime={taskInstance.start_date} /> },
4848
{ label: "End", value: <Time datetime={taskInstance.end_date} /> },
49-
{ label: "Duration", value: `${getDuration(taskInstance.start_date, taskInstance.end_date)}s` },
49+
...(Boolean(taskInstance.start_date)
50+
? [{ label: "Duration", value: `${getDuration(taskInstance.start_date, taskInstance.end_date)}s` }]
51+
: []),
5052
{
5153
label: "DAG Version",
5254
value:

0 commit comments

Comments
 (0)