diff --git a/.changes/unreleased/Fixes-20231105-125740.yaml b/.changes/unreleased/Fixes-20231105-125740.yaml new file mode 100644 index 000000000..928fbb302 --- /dev/null +++ b/.changes/unreleased/Fixes-20231105-125740.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: Fix inline comments (--) on the last line of an incremental model +time: 2023-11-05T12:57:40.289399+09:00 +custom: + Author: tnk-ysk + Issue: "896" diff --git a/dbt/include/bigquery/macros/materializations/incremental_strategy/insert_overwrite.sql b/dbt/include/bigquery/macros/materializations/incremental_strategy/insert_overwrite.sql index 4c22fd376..3ba67931e 100644 --- a/dbt/include/bigquery/macros/materializations/incremental_strategy/insert_overwrite.sql +++ b/dbt/include/bigquery/macros/materializations/incremental_strategy/insert_overwrite.sql @@ -70,7 +70,7 @@ {{ wrap_with_time_ingestion_partitioning_sql(partition_by, sql, True) }} {%- else -%} {{sql}} - {%- endif -%} + {%- endif %} ) {%- endset -%} diff --git a/tests/functional/adapter/incremental/incremental_strategy_fixtures.py b/tests/functional/adapter/incremental/incremental_strategy_fixtures.py index 8dd470ffb..a8f0004c5 100644 --- a/tests/functional/adapter/incremental/incremental_strategy_fixtures.py +++ b/tests/functional/adapter/incremental/incremental_strategy_fixtures.py @@ -306,6 +306,7 @@ {% if is_incremental() %} where date_day in ({{ config.get("partitions") | join(",") }}) {% endif %} +-- Test comment to prevent recurrence of https://github.com/dbt-labs/dbt-bigquery/issues/896 """.lstrip() overwrite_range_sql = """