Skip to content

Commit 20865fe

Browse files
committed
Add used tables crawlers for paths and queries to global context
1 parent 33fb31e commit 20865fe

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/databricks/labs/ucx/contexts/application.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from databricks.labs.ucx.recon.schema_comparator import StandardSchemaComparator
1818
from databricks.labs.ucx.source_code.directfs_access import DirectFsAccessCrawler
1919
from databricks.labs.ucx.source_code.python_libraries import PythonLibraryResolver
20+
from databricks.labs.ucx.source_code.used_table import UsedTablesCrawler
2021
from databricks.sdk import AccountClient, WorkspaceClient, core
2122
from databricks.sdk.service import sql
2223

@@ -485,6 +486,14 @@ def migration_recon(self):
485486
self.config.recon_tolerance_percent,
486487
)
487488

489+
@cached_property
490+
def used_tables_crawler_for_paths(self) -> UsedTablesCrawler:
491+
return UsedTablesCrawler.for_paths(self.sql_backend, self.config.ucx_catalog)
492+
493+
@cached_property
494+
def used_tables_crawler_for_queries(self) -> UsedTablesCrawler:
495+
return UsedTablesCrawler.for_paths(self.sql_backend, self.config.ucx_catalog)
496+
488497

489498
class CliContext(GlobalContext, abc.ABC):
490499
@cached_property

0 commit comments

Comments
 (0)