Skip to content

Commit 7f8383b

Browse files
codecaeCurtis Bangert
andauthored
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]>
1 parent 7ff86fe commit 7f8383b

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

airflow-core/src/airflow/ui/src/components/Graph/useGraphLayout.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ const generateElkGraph = ({
169169
}
170170

171171
if (!Boolean(isOpen) && node.children !== undefined) {
172+
const seenEdges = new Set<string>();
173+
172174
filteredEdges = filteredEdges
173175
// Filter out internal group edges
174176
.filter((fe) => !(childIds.includes(fe.source_id) && childIds.includes(fe.target_id)))
@@ -177,7 +179,18 @@ const generateElkGraph = ({
177179
...fe,
178180
source_id: childIds.includes(fe.source_id) ? node.id : fe.source_id,
179181
target_id: childIds.includes(fe.target_id) ? node.id : fe.target_id,
180-
}));
182+
}))
183+
// Deduplicate edges based on source_id and target_id composite
184+
.filter((fe) => {
185+
const edgeKey = `${fe.source_id}-${fe.target_id}`;
186+
187+
if (seenEdges.has(edgeKey)) {
188+
return false;
189+
}
190+
seenEdges.add(edgeKey);
191+
192+
return true;
193+
});
181194
closedGroupIds.push(node.id);
182195
}
183196

0 commit comments

Comments
 (0)