Skip to content

[sdk] Fails to detect cylic dependency #12684

@Vedant2005goyal

Description

@Vedant2005goyal

The topological sort function in the 'sdk.local.graph_utils.py' currently fails to detect the cyclic dependency in the code and proceeds without raising any error.
Reproducible code

from kfp.local import graph_utils

# Scenario: A depends on B, and B depends on A
cyclic_graph = {
    "task_A": ["task_B"],
    "task_B": ["task_A"]
}
try:
    # this should raise an error but it didn't do it
    result = graph_utils.topological_sort(cyclic_graph)
    print(f"BUG: It didnot crash. Result: {result}")
except Exception as e:
    print(f"SUCCESS: It crashed as expected: {e}")

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions