From 8e1a7c99e44075e92dcad89890cbad3149226544 Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Wed, 10 May 2023 14:45:26 -0400 Subject: [PATCH 1/2] Test core 7537 --- dev-requirements.txt | 4 ++-- tests/functional/adapter/test_constraints.py | 21 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 560176381..f8446cfd3 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,7 +1,7 @@ # install latest changes in dbt-core # TODO: how to automate switching from develop to version branches? -git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-core&subdirectory=core -git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-tests-adapter&subdirectory=tests/adapter +git+https://github.com/dbt-labs/dbt-core.git@jerco/7370-model-contracts-respect-quoting#egg=dbt-core&subdirectory=core +git+https://github.com/dbt-labs/dbt-core.git@jerco/7370-model-contracts-respect-quoting#egg=dbt-tests-adapter&subdirectory=tests/adapter # if version 1.x or greater -> pin to major version # if version 0.x -> pin to minor diff --git a/tests/functional/adapter/test_constraints.py b/tests/functional/adapter/test_constraints.py index 99ba8ec33..e9f9550ae 100644 --- a/tests/functional/adapter/test_constraints.py +++ b/tests/functional/adapter/test_constraints.py @@ -9,6 +9,7 @@ BaseIncrementalConstraintsRuntimeDdlEnforcement, BaseIncrementalConstraintsRollback, BaseModelConstraintsRuntimeEnforcement, + BaseConstraintQuotedColumn, ) @@ -126,3 +127,23 @@ def expected_sql(self): ) as model_subq ); """ + + +class TestSnowflakeConstraintQuotedColumn(BaseConstraintQuotedColumn): + @pytest.fixture(scope="class") + def expected_sql(self): + return """ +create or replace transient table ( + id integer not null, + "from" text not null, + date_day text +) as ( + select id, "from", date_day + from ( + select + 'blue' as "from", + 1 as id, + '2019-01-01' as date_day + ) as model_subq +); +""" From a65563a25b54626f378f3735c77738b1f3872454 Mon Sep 17 00:00:00 2001 From: Michelle Ark Date: Tue, 13 Jun 2023 15:34:49 -0400 Subject: [PATCH 2/2] revert dev-requirements.txt changes --- dev-requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 8eeaa82c9..20cf1e1bc 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,7 +1,7 @@ # install latest changes in dbt-core # TODO: how to automate switching from develop to version branches? -git+https://github.com/dbt-labs/dbt-core.git@jerco/7370-model-contracts-respect-quoting#egg=dbt-core&subdirectory=core -git+https://github.com/dbt-labs/dbt-core.git@jerco/7370-model-contracts-respect-quoting#egg=dbt-tests-adapter&subdirectory=tests/adapter +git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-core&subdirectory=core +git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-tests-adapter&subdirectory=tests/adapter # if version 1.x or greater -> pin to major version # if version 0.x -> pin to minor