Skip to content

Commit

Permalink
fix minor issues
Browse files Browse the repository at this point in the history
  • Loading branch information
benc-db committed Mar 6, 2025
1 parent 0495d85 commit 68c841d
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions dbt/adapters/databricks/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@

USE_MATERIALIZATION_V2 = BehaviorFlag(
name="use_materialization_v2",
default=True,
default=False,
description=(
"Use revamped materializations based on separating create and insert."
" This allows more performant column comments, as well as new column features."
Expand Down Expand Up @@ -739,19 +739,6 @@ def get_persist_doc_columns(

return return_columns

@available.parse(lambda *a, **k: {})
def get_relation_config(self, relation: DatabricksRelation) -> DatabricksRelationConfigBase:
if relation.type == DatabricksRelationType.MaterializedView:
return MaterializedViewAPI.get_from_relation(self, relation)
elif relation.type == DatabricksRelationType.StreamingTable:
return StreamingTableAPI.get_from_relation(self, relation)
elif relation.type == DatabricksRelationType.Table:
return IncrementalTableAPI.get_from_relation(self, relation)
elif relation.type == DatabricksRelationType.View:
return ViewAPI.get_from_relation(self, relation)
else:
raise NotImplementedError(f"Relation type {relation.type} is not supported.")

@available
def generate_unique_temporary_table_suffix(self, suffix_initial: str = "__dbt_tmp") -> str:
return f"{suffix_initial}_{str(uuid4())}"
Expand Down Expand Up @@ -781,6 +768,19 @@ def parse_columns_and_constraints(

return enriched_columns, parsed_constraints

@available.parse(lambda *a, **k: {})
def get_relation_config(self, relation: DatabricksRelation) -> DatabricksRelationConfigBase:
if relation.type == DatabricksRelationType.MaterializedView:
return MaterializedViewAPI.get_from_relation(self, relation)
elif relation.type == DatabricksRelationType.StreamingTable:
return StreamingTableAPI.get_from_relation(self, relation)
elif relation.type == DatabricksRelationType.Table:
return IncrementalTableAPI.get_from_relation(self, relation)
elif relation.type == DatabricksRelationType.View:
return ViewAPI.get_from_relation(self, relation)
else:
raise NotImplementedError(f"Relation type {relation.type} is not supported.")

@available.parse(lambda *a, **k: {})
def get_config_from_model(self, model: RelationConfig) -> DatabricksRelationConfigBase:
assert model.config, "Config was missing from relation"
Expand Down

0 comments on commit 68c841d

Please sign in to comment.