Skip to content

Commit

Permalink
fix leftover and failed unit tests after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
qziyuan committed Feb 21, 2024
1 parent b55a812 commit e7a3867
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/databricks/labs/ucx/azure/access.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def _map_storage(self, storage: AzureResource) -> list[StoragePermissionMapping]
client_id=role_assignment.principal.client_id,
principal=role_assignment.principal.display_name,
privilege=privilege,
directory_id = role_assignment.principal.directory_id
directory_id=role_assignment.principal.directory_id,
)
)
return out
Expand Down
6 changes: 3 additions & 3 deletions src/databricks/labs/ucx/azure/azure_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
ValidationResult,
)

from databricks.labs.ucx.assessment.azure import (
from databricks.labs.ucx.assessment.azure import AzureServicePrincipalCrawler
from databricks.labs.ucx.azure.access import (
AzureResourcePermissions,
AzureResources,
AzureServicePrincipalCrawler,
StoragePermissionMapping,
)
from databricks.labs.ucx.azure.resources import AzureResources
from databricks.labs.ucx.config import WorkspaceConfig
from databricks.labs.ucx.framework.crawlers import StatementExecutionBackend
from databricks.labs.ucx.hive_metastore.locations import ExternalLocations
Expand Down
1 change: 0 additions & 1 deletion src/databricks/labs/ucx/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

from databricks.labs.ucx.account import AccountWorkspaces, WorkspaceInfo
from databricks.labs.ucx.assessment.aws import AWSResourcePermissions

from databricks.labs.ucx.azure.access import AzureResourcePermissions
from databricks.labs.ucx.azure.azure_credentials import AzureServicePrincipalMigration
from databricks.labs.ucx.config import WorkspaceConfig
Expand Down
6 changes: 2 additions & 4 deletions tests/integration/azure/test_azure_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
import pytest
from databricks.labs.blueprint.tui import MockPrompts

from databricks.labs.ucx.assessment.azure import (
AzureServicePrincipalInfo,
StoragePermissionMapping,
)
from databricks.labs.ucx.assessment.azure import AzureServicePrincipalInfo
from databricks.labs.ucx.assessment.crawlers import _SECRET_PATTERN
from databricks.labs.ucx.azure.access import StoragePermissionMapping
from databricks.labs.ucx.azure.azure_credentials import AzureServicePrincipalMigration


Expand Down
2 changes: 1 addition & 1 deletion tests/unit/azure/test_azure_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
from databricks.labs.ucx.assessment.azure import (
AzureServicePrincipalCrawler,
AzureServicePrincipalInfo,
StoragePermissionMapping,
)
from databricks.labs.ucx.azure.access import StoragePermissionMapping
from databricks.labs.ucx.azure.azure_credentials import (
AzureServicePrincipalMigration,
ServicePrincipalMigrationInfo,
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/azure/test_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def test_role_assignments_storage(mocker, az_token):
assert len(role_assignments) == 1
for role_assignment in role_assignments:
assert role_assignment.role_name == "Contributor"
assert role_assignment.principal == Principal("appIduser2", "disNameuser2", "Iduser2")
assert role_assignment.principal == Principal("appIduser2", "disNameuser2", "Iduser2", "0000-0000")
assert str(role_assignment.scope) == resource_id
assert role_assignment.resource == AzureResource(resource_id)

Expand All @@ -75,6 +75,6 @@ def test_role_assignments_container(mocker, az_token):
assert len(role_assignments) == 1
for role_assignment in role_assignments:
assert role_assignment.role_name == "Contributor"
assert role_assignment.principal == Principal("appIduser2", "disNameuser2", "Iduser2")
assert role_assignment.principal == Principal("appIduser2", "disNameuser2", "Iduser2", "0000-0000")
assert str(role_assignment.scope) == resource_id
assert role_assignment.resource == AzureResource(resource_id)

0 comments on commit e7a3867

Please sign in to comment.