This is an automated email from the ASF dual-hosted git repository.

bbovenzi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new cd31715070 Make sure all unique run_ids render a task duration bar 
(#37717)
cd31715070 is described below

commit cd31715070b6a24e7eb189546e5191bc8f0e1756
Author: Brent Bovenzi <[email protected]>
AuthorDate: Mon Feb 26 22:29:55 2024 -0500

    Make sure all unique run_ids render a task duration bar (#37717)
---
 airflow/www/static/js/dag/details/task/TaskDuration.tsx | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/airflow/www/static/js/dag/details/task/TaskDuration.tsx 
b/airflow/www/static/js/dag/details/task/TaskDuration.tsx
index 89a18b5218..4b7eed9f3d 100644
--- a/airflow/www/static/js/dag/details/task/TaskDuration.tsx
+++ b/airflow/www/static/js/dag/details/task/TaskDuration.tsx
@@ -178,7 +178,7 @@ const TaskDuration = () => {
     ],
     // @ts-ignore
     dataset: {
-      dimensions: [orderingLabel, "queuedDurationUnit", "runDurationUnit"],
+      dimensions: ["runId", "queuedDurationUnit", "runDurationUnit"],
       source: durations,
     },
     tooltip: {
@@ -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",

Reply via email to