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 02003219d69 Use updated data from Dags API for Dag with recent DagRun.
(#43857)
02003219d69 is described below
commit 02003219d695af23b419eaa7213e5bee0644be1c
Author: Karthikeyan Singaravelan <[email protected]>
AuthorDate: Mon Nov 11 22:37:25 2024 +0530
Use updated data from Dags API for Dag with recent DagRun. (#43857)
---
airflow/ui/src/queries/useDags.tsx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/airflow/ui/src/queries/useDags.tsx
b/airflow/ui/src/queries/useDags.tsx
index 2255ec06332..12009bd85e0 100644
--- a/airflow/ui/src/queries/useDags.tsx
+++ b/airflow/ui/src/queries/useDags.tsx
@@ -69,7 +69,11 @@ export const useDags = (
(runsDag) => runsDag.dag_id === dag.dag_id,
);
- return dagWithRuns ?? { ...dag, latest_dag_runs: [] };
+ // For dags with recent dag runs replace the dag data from
useDagsServiceRecentDagRuns
+ // which might be stale with updated dag data from useDagServiceGetDags
+ return dagWithRuns
+ ? { ...dagWithRuns, ...dag }
+ : { ...dag, latest_dag_runs: [] };
});
return {