From f774bcbd181fcdd7bb0ce8295e9f93aedfcfe32a Mon Sep 17 00:00:00 2001 From: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> Date: Thu, 14 Dec 2023 16:45:14 -0700 Subject: [PATCH] Remove unused `invalid_insert_overwrite_delta_msg` variable (#963) * Remove `invalid_insert_overwrite_delta_msg` message * Changelog entry --- .changes/unreleased/Under the Hood-20231214-134728.yaml | 6 ++++++ .../spark/macros/materializations/incremental/validate.sql | 7 +------ 2 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 .changes/unreleased/Under the Hood-20231214-134728.yaml diff --git a/.changes/unreleased/Under the Hood-20231214-134728.yaml b/.changes/unreleased/Under the Hood-20231214-134728.yaml new file mode 100644 index 000000000..b1de2ddb7 --- /dev/null +++ b/.changes/unreleased/Under the Hood-20231214-134728.yaml @@ -0,0 +1,6 @@ +kind: Under the Hood +body: Remove unused `invalid_insert_overwrite_delta_msg` message +time: 2023-12-14T13:47:28.444107-07:00 +custom: + Author: dbeatty10 + Issue: "962" diff --git a/dbt/include/spark/macros/materializations/incremental/validate.sql b/dbt/include/spark/macros/materializations/incremental/validate.sql index 88b851ca4..0d4c4d8b6 100644 --- a/dbt/include/spark/macros/materializations/incremental/validate.sql +++ b/dbt/include/spark/macros/materializations/incremental/validate.sql @@ -29,17 +29,12 @@ You can only choose this strategy when file_format is set to 'delta' or 'iceberg' or 'hudi' {%- endset %} - {% set invalid_insert_overwrite_delta_msg -%} - Invalid incremental strategy provided: {{ raw_strategy }} - You cannot use this strategy when file_format is set to 'delta' or 'iceberg' - Use the 'append' or 'merge' strategy instead - {%- endset %} - {% set invalid_insert_overwrite_endpoint_msg -%} Invalid incremental strategy provided: {{ raw_strategy }} You cannot use this strategy when connecting via endpoint Use the 'append' or 'merge' strategy instead {%- endset %} + {% if raw_strategy not in ['append', 'merge', 'insert_overwrite'] %} {% do exceptions.raise_compiler_error(invalid_strategy_msg) %} {%-else %}