Skip to content

Commit 206cb36

Browse files
committed
formatting
1 parent 4e2aedc commit 206cb36

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/databricks/labs/ucx/sequencing/sequencing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def register_cluster(self, cluster_id: str) -> MigrationNode:
181181
return cluster_node
182182

183183
def generate_steps(self) -> Iterable[MigrationStep]:
184-
""" The below algo is adapted from Kahn's topological sort.
184+
"""The below algo is adapted from Kahn's topological sort.
185185
The main differences are as follows:
186186
1) we want the same step number for all nodes with same dependency depth
187187
so instead of pushing 'leaf' nodes to a queue, we fetch them again once all current 'leaf' nodes are processed
@@ -190,7 +190,7 @@ def generate_steps(self) -> Iterable[MigrationStep]:
190190
so when fetching 'leaf' nodes, we relax the 0-incoming-vertex rule in order
191191
to avoid an infinite loop. We also avoid side effects (such as negative counts).
192192
This algo works correctly for simple cases, but is not tested on large trees.
193-
"""
193+
"""
194194
incoming_counts = self._populate_incoming_counts()
195195
step_number = 1
196196
sorted_steps: list[MigrationStep] = []

tests/unit/sequencing/test_sequencing.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,13 @@ def test_sequencer_supports_cyclic_dependencies(ws, simple_dependency_resolver,
9696
root = Dependency(FileLoader(), Path("root.py"))
9797
root_graph = _DependencyGraph(root, None, simple_dependency_resolver, mock_path_lookup, CurrentSessionState())
9898
child_a = Dependency(FileLoader(), Path("a.py"))
99-
child_graph_a = _DependencyGraph(child_a, root_graph, simple_dependency_resolver, mock_path_lookup, CurrentSessionState())
99+
child_graph_a = _DependencyGraph(
100+
child_a, root_graph, simple_dependency_resolver, mock_path_lookup, CurrentSessionState()
101+
)
100102
child_b = Dependency(FileLoader(), Path("b.py"))
101-
child_graph_b = _DependencyGraph(child_b, root_graph, simple_dependency_resolver, mock_path_lookup, CurrentSessionState())
103+
child_graph_b = _DependencyGraph(
104+
child_b, root_graph, simple_dependency_resolver, mock_path_lookup, CurrentSessionState()
105+
)
102106
# root imports a and b
103107
root_graph.add_dependency(child_graph_a)
104108
root_graph.add_dependency(child_graph_b)
@@ -112,4 +116,3 @@ def test_sequencer_supports_cyclic_dependencies(ws, simple_dependency_resolver,
112116
steps = list(sequencer.generate_steps())
113117
assert len(steps) == 3
114118
assert steps[2].object_id == "root.py"
115-

0 commit comments

Comments
 (0)