Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using incremental tables, the column data types are invalidly updated #269

Merged
merged 5 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions dbt/adapters/base/column.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@ def numeric_type(cls, dtype: str, precision: Any, scale: Any) -> str:
else:
return "{}({},{})".format(dtype, precision, scale)

def __repr__(self) -> str:
return "<Column {} ({})>".format(self.name, self.data_type)

@classmethod
def from_description(cls, name: str, raw_data_type: str) -> "Column":
match = re.match(r"([^(]+)(\([^)]+\))?", raw_data_type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@
{% set need_swap = true %}
{% else %}
{% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}
{% do adapter.expand_target_column_types(
from_relation=temp_relation,
to_relation=target_relation) %}
{% set contract_config = config.get('contract') %}
{% if not contract_config.enforced %}
mikealfare marked this conversation as resolved.
Show resolved Hide resolved
{% do adapter.expand_target_column_types(
from_relation=temp_relation,
to_relation=target_relation) %}
{% endif %}
{#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}
{% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}
{% if not dest_columns %}
Expand Down
Loading