Skip to content

Commit 575d624

Browse files
committed
Addressed testing and formatting errors.
1 parent d3d38a9 commit 575d624

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/databricks/labs/ucx/workspace_access/generic.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ def _crawl(self) -> list[WorkspaceObjectInfo]:
300300
raw = obj.as_dict()
301301
yield WorkspaceObjectInfo(
302302
object_type=raw.get("object_type", None),
303-
object_id=raw.get("object_id", None),
303+
object_id=str(raw.get("object_id", None)),
304304
path=raw.get("path", None),
305305
language=raw.get("language", None),
306306
)
@@ -310,7 +310,9 @@ def snapshot(self) -> list[WorkspaceObjectInfo]:
310310

311311
def _try_fetch(self) -> list[WorkspaceObjectInfo]:
312312
for row in self._fetch(f"SELECT * FROM {self._schema}.{self._table}"):
313-
yield WorkspaceObjectInfo(path=row["path"],object_type=row["object_type"],object_id=row["object_id"],language=row["language"])
313+
yield WorkspaceObjectInfo(
314+
path=row["path"], object_type=row["object_type"], object_id=row["object_id"], language=row["language"]
315+
)
314316

315317
def object_types(self) -> set[str]:
316318
return {"notebooks", "directories", "repos", "files"}

tests/unit/workspace_access/test_generic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ def test_workspaceobject_crawl():
560560
result_set = list(crawler)
561561

562562
assert len(result_set) == 2
563-
assert result_set[0] == WorkspaceObjectInfo( "/rootobj/notebook1", "NOTEBOOK", 123, "PYTHON")
563+
assert result_set[0] == WorkspaceObjectInfo("/rootobj/notebook1", "NOTEBOOK", "123", "PYTHON")
564564

565565

566566
def test_workspaceobject_withexperiment_crawl():
@@ -587,7 +587,7 @@ def test_workspaceobject_withexperiment_crawl():
587587
result_set = list(crawler)
588588

589589
assert len(result_set) == 1
590-
assert result_set[0] == WorkspaceObjectInfo("/rootobj/notebook1", "NOTEBOOK", 123, "PYTHON")
590+
assert result_set[0] == WorkspaceObjectInfo("/rootobj/notebook1", "NOTEBOOK", "123", "PYTHON")
591591

592592

593593
def test_workspace_snapshot():

0 commit comments

Comments
 (0)