From 2163952a9fe02bb4f3291e6591a8797ab4df9fae Mon Sep 17 00:00:00 2001 From: Peter Allen Webb Date: Wed, 18 Dec 2024 15:23:51 -0500 Subject: [PATCH] Wrap queries in begin/end block for better Snowflake compatibility. --- .../dbt/tests/adapter/simple_snapshot/new_record_mode.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dbt-tests-adapter/dbt/tests/adapter/simple_snapshot/new_record_mode.py b/dbt-tests-adapter/dbt/tests/adapter/simple_snapshot/new_record_mode.py index c50f0ff9..f2f0f3b5 100644 --- a/dbt-tests-adapter/dbt/tests/adapter/simple_snapshot/new_record_mode.py +++ b/dbt-tests-adapter/dbt/tests/adapter/simple_snapshot/new_record_mode.py @@ -3,6 +3,8 @@ from dbt.tests.util import check_relations_equal, run_dbt _seed_new_record_mode = """ +BEGIN + create table {database}.{schema}.seed ( id INTEGER, first_name VARCHAR(50), @@ -88,6 +90,8 @@ md5(id || '-' || first_name || '|' || updated_at::text) as dbt_scd_id, 'False' as dbt_is_deleted from {database}.{schema}.seed; + +END; """ _snapshot_actual_sql = """ @@ -119,6 +123,8 @@ _invalidate_sql = """ +BEGIN + -- update records 11 - 21. Change email and updated_at field update {schema}.seed set updated_at = updated_at + interval '1 hour', @@ -131,6 +137,7 @@ dbt_valid_to = updated_at + interval '1 hour' where id >= 10 and id <= 20; +END; """ _update_sql = """