Skip to content

Commit

Permalink
Addressed testing errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
FastLee committed Nov 9, 2023
1 parent f535013 commit d3d38a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/databricks/labs/ucx/workspace_access/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def snapshot(self) -> list[WorkspaceObjectInfo]:

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

def object_types(self) -> set[str]:
return {"notebooks", "directories", "repos", "files"}
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/workspace_access/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ def test_workspaceobject_try_fetch():
result_set = list(crawler._try_fetch())

assert len(result_set) == 2
assert result_set[0] == WorkspaceObjectInfo("NOTEBOOK", 123, "/rootobj/notebook1", "PYTHON")
assert result_set[0] == WorkspaceObjectInfo("/rootobj/notebook1", "NOTEBOOK", 123, "PYTHON")


def test_workspaceobject_crawl():
Expand Down Expand Up @@ -560,7 +560,7 @@ def test_workspaceobject_crawl():
result_set = list(crawler)

assert len(result_set) == 2
assert result_set[0] == WorkspaceObjectInfo("NOTEBOOK", "123", "/rootobj/notebook1", "PYTHON")
assert result_set[0] == WorkspaceObjectInfo( "/rootobj/notebook1", "NOTEBOOK", 123, "PYTHON")


def test_workspaceobject_withexperiment_crawl():
Expand All @@ -587,7 +587,7 @@ def test_workspaceobject_withexperiment_crawl():
result_set = list(crawler)

assert len(result_set) == 1
assert result_set[0] == WorkspaceObjectInfo("NOTEBOOK", "123", "/rootobj/notebook1", "PYTHON")
assert result_set[0] == WorkspaceObjectInfo("/rootobj/notebook1", "NOTEBOOK", 123, "PYTHON")


def test_workspace_snapshot():
Expand All @@ -613,7 +613,7 @@ def test_workspace_snapshot():
result_set = crawler.snapshot()

assert len(result_set) == 2
assert result_set[0] == WorkspaceObjectInfo("NOTEBOOK", "123", "/rootobj/notebook1", "PYTHON")
assert result_set[0] == WorkspaceObjectInfo("/rootobj/notebook1", "NOTEBOOK", "123", "PYTHON")


def test_eligibles_assets_with_owner_should_be_accepted():
Expand Down

0 comments on commit d3d38a9

Please sign in to comment.