This is an automated email from the ASF dual-hosted git repository.
pierrejeambrun 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 7f8383b1d98 fix: corrects issues with edge rendering on the graph view
(#53998)
7f8383b1d98 is described below
commit 7f8383b1d98df8ee6b510af0f4a0564970624c24
Author: codecae <[email protected]>
AuthorDate: Tue Aug 12 09:29:35 2025 -0400
fix: corrects issues with edge rendering on the graph view (#53998)
* fix: corrects issues with edge rendering on the graph view
* fix: moved edge deduplication logic to formatChildNode.
---------
Co-authored-by: Curtis Bangert <[email protected]>
---
.../src/airflow/ui/src/components/Graph/useGraphLayout.ts | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/airflow-core/src/airflow/ui/src/components/Graph/useGraphLayout.ts
b/airflow-core/src/airflow/ui/src/components/Graph/useGraphLayout.ts
index d34491612c1..4dae977ff3c 100644
--- a/airflow-core/src/airflow/ui/src/components/Graph/useGraphLayout.ts
+++ b/airflow-core/src/airflow/ui/src/components/Graph/useGraphLayout.ts
@@ -169,6 +169,8 @@ const generateElkGraph = ({
}
if (!Boolean(isOpen) && node.children !== undefined) {
+ const seenEdges = new Set<string>();
+
filteredEdges = filteredEdges
// Filter out internal group edges
.filter((fe) => !(childIds.includes(fe.source_id) &&
childIds.includes(fe.target_id)))
@@ -177,7 +179,18 @@ const generateElkGraph = ({
...fe,
source_id: childIds.includes(fe.source_id) ? node.id : fe.source_id,
target_id: childIds.includes(fe.target_id) ? node.id : fe.target_id,
- }));
+ }))
+ // Deduplicate edges based on source_id and target_id composite
+ .filter((fe) => {
+ const edgeKey = `${fe.source_id}-${fe.target_id}`;
+
+ if (seenEdges.has(edgeKey)) {
+ return false;
+ }
+ seenEdges.add(edgeKey);
+
+ return true;
+ });
closedGroupIds.push(node.id);
}