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

pierrejeambrun pushed a commit to branch v3-0-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v3-0-test by this push:
     new f0017e75062 [v3-0-test] fix: corrects issues with edge rendering on 
the graph view (#53998) (#54412)
f0017e75062 is described below

commit f0017e75062943fcb8a3ae0f01190f04439e0dad
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Aug 12 16:46:48 2025 +0200

    [v3-0-test] fix: corrects issues with edge rendering on the graph view 
(#53998) (#54412)
    
    * fix: corrects issues with edge rendering on the graph view
    
    * fix: moved edge deduplication logic to formatChildNode.
    
    ---------
    (cherry picked from commit 7f8383b1d98df8ee6b510af0f4a0564970624c24)
    
    Co-authored-by: codecae <[email protected]>
    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 9c74318db75..d09455e08b0 100644
--- a/airflow-core/src/airflow/ui/src/components/Graph/useGraphLayout.ts
+++ b/airflow-core/src/airflow/ui/src/components/Graph/useGraphLayout.ts
@@ -167,6 +167,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)))
@@ -175,7 +177,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);
     }
 

Reply via email to