|
7 | 7 | from databricks.labs.lsql.backends import SqlBackend |
8 | 8 | from databricks.sdk import WorkspaceClient |
9 | 9 | from databricks.sdk.errors import DatabricksError, NotFound |
10 | | -from databricks.sdk.service.catalog import CatalogInfo, CatalogInfoSecurableKind, SchemaInfo |
| 10 | +from databricks.sdk.service.catalog import CatalogInfo, CatalogType, SchemaInfo |
11 | 11 |
|
12 | 12 | from databricks.labs.ucx.framework.crawlers import CrawlerBase |
13 | 13 | from databricks.labs.ucx.framework.utils import escape_sql_identifier |
@@ -79,10 +79,9 @@ class TableMigrationStatusRefresher(CrawlerBase[TableMigrationStatus]): |
79 | 79 | properties for the presence of the marker. |
80 | 80 | """ |
81 | 81 |
|
82 | | - _skip_catalog_securable_kinds = [ |
83 | | - CatalogInfoSecurableKind.CATALOG_INTERNAL, |
84 | | - CatalogInfoSecurableKind.CATALOG_SYSTEM, |
85 | | - ] |
| 82 | + _skip_catalog_types = { |
| 83 | + CatalogType.SYSTEM_CATALOG, |
| 84 | + } |
86 | 85 |
|
87 | 86 | def __init__(self, ws: WorkspaceClient, sql_backend: SqlBackend, schema, tables_crawler: TablesCrawler): |
88 | 87 | super().__init__(sql_backend, "hive_metastore", schema, "migration_status", TableMigrationStatus) |
@@ -163,7 +162,7 @@ def _try_fetch(self) -> Iterable[TableMigrationStatus]: |
163 | 162 | def _iter_catalogs(self) -> Iterable[CatalogInfo]: |
164 | 163 | try: |
165 | 164 | for catalog in self._ws.catalogs.list(): |
166 | | - if catalog.securable_kind in self._skip_catalog_securable_kinds: |
| 165 | + if catalog.catalog_type in self._skip_catalog_types: |
167 | 166 | continue |
168 | 167 | yield catalog |
169 | 168 | except DatabricksError as e: |
|
0 commit comments