Skip to content

Commit 210a048

Browse files
committed
Add typehint for migration node id
1 parent ffb9234 commit 210a048

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ class MigrationStep:
2626
required_step_ids: list[int]
2727

2828

29+
MigrationNodeKey = tuple[str, str]
30+
31+
2932
@dataclass
3033
class MigrationNode:
3134
node_id: int
@@ -35,7 +38,7 @@ class MigrationNode:
3538
object_owner: str
3639

3740
@property
38-
def key(self) -> tuple[str, str]:
41+
def key(self) -> MigrationNodeKey:
3942
return self.object_type, self.object_id
4043

4144
def as_step(self, step_number: int, required_step_ids: list[int]) -> MigrationStep:
@@ -124,8 +127,8 @@ def __init__(self, ws: WorkspaceClient, admin_locator: AdministratorLocator):
124127
self._ws = ws
125128
self._admin_locator = admin_locator
126129
self._last_node_id = 0
127-
self._nodes: dict[tuple[str, str], MigrationNode] = {}
128-
self._outgoing: dict[tuple[str, str], set[tuple[str, str]]] = defaultdict(set)
130+
self._nodes: dict[MigrationNodeKey, MigrationNode] = {}
131+
self._outgoing: dict[MigrationNodeKey, set[MigrationNodeKey]] = defaultdict(set)
129132

130133
def register_workflow_task(self, task: jobs.Task, job: jobs.Job, _graph: DependencyGraph) -> MigrationNode:
131134
task_id = f"{job.job_id}/{task.task_key}"

0 commit comments

Comments
 (0)