1313from dbt .adapters .databricks .credentials import (
1414 CATALOG_KEY_IN_SESSION_PROPERTIES ,
1515)
16- from dbt .adapters .databricks .impl import get_identifier_list_string
17- from dbt .adapters .databricks .relation import DatabricksRelation , DatabricksRelationType
16+ from dbt .adapters .databricks .impl import (
17+ DatabricksRelationInfo ,
18+ get_identifier_list_string ,
19+ )
20+ from dbt .adapters .databricks .relation import (
21+ DatabricksRelation ,
22+ DatabricksRelationType ,
23+ DatabricksTableType ,
24+ )
1825from dbt .adapters .databricks .utils import check_not_found_error
1926from dbt .config import RuntimeConfig
2027from tests .unit .utils import config_from_parts_or_dicts
@@ -356,7 +363,9 @@ def test_list_relations_without_caching__no_relations(self, _):
356363 @patch ("dbt.adapters.databricks.api_client.DatabricksApiClient.create" )
357364 def test_list_relations_without_caching__some_relations (self , _ ):
358365 with patch .object (DatabricksAdapter , "get_relations_without_caching" ) as mocked :
359- mocked .return_value = [("name" , "table" , "hudi" , "owner" )]
366+ mocked .return_value = [
367+ DatabricksRelationInfo ("name" , "table" , "hudi" , "owner" , "external" )
368+ ]
360369 adapter = DatabricksAdapter (Mock (flags = {}), get_context ("spawn" ))
361370 relations = adapter .list_relations ("database" , "schema" )
362371 assert len (relations ) == 1
@@ -365,13 +374,17 @@ def test_list_relations_without_caching__some_relations(self, _):
365374 assert relation .database == "database"
366375 assert relation .schema == "schema"
367376 assert relation .type == DatabricksRelationType .Table
377+ assert relation .databricks_table_type == DatabricksTableType .External
368378 assert relation .owner == "owner"
379+ assert relation .is_external_table
369380 assert relation .is_hudi
370381
371382 @patch ("dbt.adapters.databricks.api_client.DatabricksApiClient.create" )
372383 def test_list_relations_without_caching__hive_relation (self , _ ):
373384 with patch .object (DatabricksAdapter , "get_relations_without_caching" ) as mocked :
374- mocked .return_value = [("name" , "table" , None , None )]
385+ mocked .return_value = [
386+ DatabricksRelationInfo ("name" , "table" , None , None , None )
387+ ]
375388 adapter = DatabricksAdapter (Mock (flags = {}), get_context ("spawn" ))
376389 relations = adapter .list_relations ("database" , "schema" )
377390 assert len (relations ) == 1
0 commit comments