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

adding transient dynamic table capabilities #1210

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
correcting logic
  • Loading branch information
jhsb25 committed Oct 17, 2024
commit b2e4fbbb1ab73cb375de41d2ec07d2a752f717b2
2 changes: 1 addition & 1 deletion dbt/adapters/snowflake/relation.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def get_ddl_prefix_for_create(self, config: RelationConfig, temporary: bool) ->
support temporary relations.
"""

transient_explicitly_set_true: bool = config.get("transient", False)
transient_explicitly_set_true: bool = config.extra.get("transient", False)

# Temporary tables are a Snowflake feature that do not exist in the
# Iceberg framework. We ignore the Iceberg status of the model.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
-#}

{%- set dynamic_table = relation.from_config(config.model) -%}
{%- set materialization_prefix = relation.get_ddl_prefix_for_create(config.model.config, False) -%}

{%- if dynamic_table.catalog.table_format == 'iceberg' -%}
{{ _get_create_dynamic_iceberg_table_as_sql(dynamic_table, relation, sql) }}
Expand Down Expand Up @@ -42,6 +41,8 @@
-- A valid DDL statement which will result in a new dynamic standard table.
-#}

{%- set materialization_prefix = relation.get_ddl_prefix_for_create(config.model.config, False) -%}

create {{ materialization_prefix }} dynamic table {{ relation }}
target_lag = '{{ dynamic_table.target_lag }}'
warehouse = {{ dynamic_table.snowflake_warehouse }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
-#}

{%- set dynamic_table = relation.from_config(config.model) -%}
{%- set materialization_prefix = relation.get_ddl_prefix_for_create(config.model.config, False) -%}

{%- if dynamic_table.catalog.table_format == 'iceberg' -%}
{{ _get_replace_dynamic_iceberg_table_as_sql(dynamic_table, relation, sql) }}
Expand All @@ -41,6 +40,8 @@
-- A valid DDL statement which will result in a new dynamic standard table.
-#}

{%- set materialization_prefix = relation.get_ddl_prefix_for_create(config.model.config, False) -%}

create or replace {{ materialization_prefix }} dynamic table {{ relation }}
target_lag = '{{ dynamic_table.target_lag }}'
warehouse = {{ dynamic_table.snowflake_warehouse }}
Expand Down