bbovenzi commented on code in PR #38374:
URL: https://github.com/apache/airflow/pull/38374#discussion_r1534274512


##########
airflow/www/static/js/dag/details/task/TaskDuration.tsx:
##########
@@ -179,7 +170,18 @@ const TaskDuration = () => {
     // @ts-ignore
     dataset: {
       dimensions: ["runId", "queuedDurationUnit", "runDurationUnit"],
-      source: durations,
+      source: durations.map((duration) => {
+        if (duration) {
+          const durationInSeconds = duration as TaskInstanceDuration;

Review Comment:
   Actually we can drop the `<RunDuration | {}>[]` and just have `RunDuration[]`
   
   
   And for taskDurations we can change from `map` to `forEach` like so:
   
   ``` 
   const durations: TaskInstanceDuration[] = [];
   
     dagRuns.forEach((dagRun) => {
       const { runId } = dagRun;
       const instance = task.instances.find((ti) => ti && ti.runId === runId);
       if (instance) {
    ```
    
    and then
    
    ```
         durations.push({
           ...instance,
           [orderingLabel]: dagRun ? dagRun[orderingLabel] : instance.startDate,
           runDuration,
           queuedDuration,
           runDurationUnit,
           queuedDurationUnit,
         });
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to