pierrejeambrun commented on code in PR #53998:
URL: https://github.com/apache/airflow/pull/53998#discussion_r2251483301


##########
airflow-core/src/airflow/ui/src/components/Graph/useGraphLayout.ts:
##########
@@ -210,7 +210,20 @@ const generateElkGraph = ({
 
   const children = nodes.map(formatChildNode);
 
-  const edges = filteredEdges.map((fe) => formatElkEdge(fe, font));
+  // Deduplicate edges that point to the same source/target
+  const edgeMap = new Map<string, EdgeResponse>();
+
+  filteredEdges.forEach((edge) => {
+    const edgeKey = `${edge.source_id}-${edge.target_id}`;
+
+    if (!edgeMap.has(edgeKey)) {
+      edgeMap.set(edgeKey, edge);
+    }
+  });
+
+  // Convert back to array and create formatted edges
+  const deduplicatedEdges = [...edgeMap.values()];
+  const edges = deduplicatedEdges.map((fe) => formatElkEdge(fe, font));

Review Comment:
   The backend shouldn't return duplicated edges like this. We probably should 
fix it there.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to