fix: Fix check cycle of graph bug

This commit is contained in:
Fangyin Cheng
2024-02-05 15:17:37 +08:00
parent fca5772c87
commit 6485a13b5b

View File

@@ -558,7 +558,7 @@ def _topological_sort(
if in_degree[adjacent] == 0:
queue.append(adjacent)
if len(key_to_order) != len(keys):
if current_order != len(keys):
raise ValueError("Graph has at least one cycle")
return key_to_order