Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop dependency on toposort in favour of built-in graphlib #3728

Merged
merged 6 commits into from
Mar 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion kedro/pipeline/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,9 @@ def _toposort(node_dependencies: dict[Node, set[Node]]) -> list[Node]:
"""
try:
sorter = TopologicalSorter(node_dependencies)
return list(sorter.static_order())
# Ensure stable toposort by sorting the nodes in a group
groups = _group_toposorted(sorter.static_order(), node_dependencies)
return [n for group in groups for n in group]
idanov marked this conversation as resolved.
Show resolved Hide resolved
except CycleError as exc:
message = f"Circular dependencies exist among these items: {exc.args[1]}"
raise CircularDependencyError(message) from exc
Expand Down