mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-07-23 09:22:18 +00:00
MINOR: Fix unity catalog test connection (#15712)
This commit is contained in:
parent
ec4673587d
commit
6acb47a87a
@ -68,16 +68,20 @@ def test_connection(
|
|||||||
break
|
break
|
||||||
|
|
||||||
def get_schemas(connection: WorkspaceClient, table_obj: DatabricksTable):
|
def get_schemas(connection: WorkspaceClient, table_obj: DatabricksTable):
|
||||||
for schema in connection.schemas.list(catalog_name=table_obj.catalog_name):
|
for catalog in connection.catalogs.list():
|
||||||
table_obj.schema_name = schema.name
|
for schema in connection.schemas.list(catalog_name=catalog.name):
|
||||||
break
|
if schema.name:
|
||||||
|
table_obj.schema_name = schema.name
|
||||||
|
table_obj.catalog_name = catalog.name
|
||||||
|
return
|
||||||
|
|
||||||
def get_tables(connection: WorkspaceClient, table_obj: DatabricksTable):
|
def get_tables(connection: WorkspaceClient, table_obj: DatabricksTable):
|
||||||
for table in connection.tables.list(
|
if table_obj.catalog_name and table_obj.schema_name:
|
||||||
catalog_name=table_obj.catalog_name, schema_name=table_obj.schema_name
|
for table in connection.tables.list(
|
||||||
):
|
catalog_name=table_obj.catalog_name, schema_name=table_obj.schema_name
|
||||||
table_obj.name = table.name
|
):
|
||||||
break
|
table_obj.name = table.name
|
||||||
|
break
|
||||||
|
|
||||||
test_fn = {
|
test_fn = {
|
||||||
"CheckAccess": connection.catalogs.list,
|
"CheckAccess": connection.catalogs.list,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user