Skip to content

Commit

Permalink
Make sure all unique run_ids render a task duration bar (#37717)
Browse files Browse the repository at this point in the history
  • Loading branch information
bbovenzi committed Feb 27, 2024
1 parent fc80a24 commit cd31715
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions airflow/www/static/js/dag/details/task/TaskDuration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ const TaskDuration = () => {
],
// @ts-ignore
dataset: {
dimensions: [orderingLabel, "queuedDurationUnit", "runDurationUnit"],
dimensions: ["runId", "queuedDurationUnit", "runDurationUnit"],
source: durations,
},
tooltip: {
Expand All @@ -192,9 +192,12 @@ const TaskDuration = () => {
type: "category",
show: true,
axisLabel: {
formatter: (value: string) =>
formatter: (runId: string) => {
const dagRun = dagRuns.find((dr) => dr.runId === runId);
if (!dagRun || !dagRun[orderingLabel]) return runId;
// @ts-ignore
value ? moment(value).format(defaultFormat) : "",
return moment(dagRun[orderingLabel]).format(defaultFormat);
},
},
name: startCase(orderingLabel),
nameLocation: "end",
Expand Down

0 comments on commit cd31715

Please sign in to comment.