Skip to content

Commit

Permalink
remove superfluous need_drop_temp variable and add temp_relation to t…
Browse files Browse the repository at this point in the history
…o_drop within if-statement
  • Loading branch information
guenp committed Feb 1, 2024
1 parent 0ed05bf commit 15e61b4
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions dbt/include/duckdb/macros/materializations/incremental.sql
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
{% set temp_relation = temp_relation.incorporate(path=adapter.get_temp_relation_path(this)) %}
{% do run_query(create_schema(temp_relation)) %}
-- then drop the temp relation after we insert the incremental data into the target relation
{% set need_drop_temp = True %}
{% do to_drop.append(temp_relation) %}
{% endif %}
{% if language == 'python' %}
{% set build_python = create_table_as(False, temp_relation, compiled_code, language) %}
Expand Down Expand Up @@ -85,10 +85,6 @@
{% do to_drop.append(backup_relation) %}
{% endif %}

{% if need_drop_temp %}
{% do to_drop.append(temp_relation) %}
{% endif %}

{% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}
{% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}

Expand Down

0 comments on commit 15e61b4

Please sign in to comment.