Skip to content

Commit b4128cc

Browse files
authored
Addressed integration test issue (#839)
Fixed and issue introduced with PR #825
1 parent ae54f76 commit b4128cc

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from databricks.sdk import WorkspaceClient
66
from databricks.sdk.errors import NotFound
7+
from databricks.sdk.service import compute
78
from databricks.sdk.service.compute import ClusterDetails, ClusterSource, Policy
89

910
from databricks.labs.ucx.assessment.crawlers import (
@@ -67,17 +68,21 @@ def _check_init_scripts(self, cluster, failures):
6768
continue
6869
failures.append(f"{_AZURE_SP_CONF_FAILURE_MSG} cluster.")
6970

70-
def _check_cluster_failures(self, cluster: ClusterDetails):
71+
def _check_cluster_failures(self, cluster: ClusterDetails | compute.ClusterSpec):
7172
failures = []
72-
if not cluster.creator_user_name:
73+
if isinstance(cluster, ClusterDetails) and not cluster.creator_user_name:
7374
logger.warning(
7475
f"Cluster {cluster.cluster_id} have Unknown creator, it means that the original creator "
7576
f"has been deleted and should be re-created"
7677
)
78+
cluster_id = cluster.cluster_id if isinstance(cluster, ClusterDetails) and cluster.cluster_id else ""
79+
creator_user_name = (
80+
cluster.creator_user_name if isinstance(cluster, ClusterDetails) and cluster.creator_user_name else None
81+
)
7782
cluster_info = ClusterInfo(
78-
cluster_id=cluster.cluster_id if cluster.cluster_id else "",
83+
cluster_id=cluster_id,
7984
cluster_name=cluster.cluster_name,
80-
creator=cluster.creator_user_name,
85+
creator=creator_user_name,
8186
success=1,
8287
failures="[]",
8388
)

0 commit comments

Comments
 (0)