Skip to content

Commit

Permalink
fix column issue
Browse files Browse the repository at this point in the history
  • Loading branch information
benc-db committed Oct 11, 2024
1 parent 4834834 commit 23d7283
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions dbt/adapters/databricks/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from typing import Type
from typing import TYPE_CHECKING
from typing import Union
from uuid import uuid4

from dbt.adapters.base import AdapterConfig
from dbt.adapters.base import PythonJobHelper
Expand Down Expand Up @@ -55,9 +54,6 @@
from dbt.adapters.databricks.python_models.python_submissions import (
ServerlessClusterPythonJobHelper,
)
from dbt.adapters.databricks.python_models.python_submissions import (
WorkflowPythonJobHelper,
)
from dbt.adapters.databricks.relation import DatabricksRelation
from dbt.adapters.databricks.relation import DatabricksRelationType
from dbt.adapters.databricks.relation import KEY_TABLE_PROVIDER
Expand Down Expand Up @@ -126,7 +122,6 @@ class DatabricksConfig(AdapterConfig):
databricks_tags: Optional[Dict[str, str]] = None
tblproperties: Optional[Dict[str, str]] = None
zorder: Optional[Union[List[str], str]] = None
unique_tmp_table_suffix: bool = False
skip_non_matched_step: Optional[bool] = None
skip_matched_step: Optional[bool] = None
matched_condition: Optional[str] = None
Expand Down Expand Up @@ -658,7 +653,6 @@ def python_submission_helpers(self) -> Dict[str, Type[PythonJobHelper]]:
"job_cluster": JobClusterPythonJobHelper,
"all_purpose_cluster": AllPurposeClusterPythonJobHelper,
"serverless_cluster": ServerlessClusterPythonJobHelper,
"workflow_job": WorkflowPythonJobHelper,
}

@available
Expand Down Expand Up @@ -699,12 +693,14 @@ def get_persist_doc_columns(
# an error when we tried to alter the table.
for column in existing_columns:
name = column.column
if (
name in columns
and columns[name].description
and columns[name].description != (column.comment or "")
):
return_columns[name] = columns[name]
if name in columns:
config_column = columns[name]
if isinstance(config_column, dict):
comment = columns[name].get("description", "")
else:
comment = config_column.description
if comment != (column.comment or ""):
return_columns[name] = columns[name]

return return_columns

Expand Down Expand Up @@ -733,10 +729,6 @@ def get_config_from_model(self, model: RelationConfig) -> DatabricksRelationConf
f"Materialization {model.config.materialized} is not supported."
)

@available
def generate_unique_temporary_table_suffix(self, suffix_initial: str = "__dbt_tmp") -> str:
return f"{suffix_initial}_{str(uuid4())}"


@dataclass(frozen=True)
class RelationAPIBase(ABC, Generic[DatabricksRelationConfig]):
Expand Down

0 comments on commit 23d7283

Please sign in to comment.