From 750a7f0b72581d3046e7caa06068c73981de9762 Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Wed, 10 May 2023 10:12:14 -0400 Subject: [PATCH 1/3] Test core 7537 --- dev-requirements.txt | 6 +++--- tests/functional/adapter/test_constraints.py | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 963e64bbc..66ebb1bdf 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,8 +1,8 @@ # install latest changes in dbt-core + dbt-postgres # TODO: how to switch from HEAD to x.y.latest branches after minor releases? -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#egg=dbt-postgres&subdirectory=plugins/postgres +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@jerco/7370-model-contracts-respect-quoting#egg=dbt-postgres&subdirectory=plugins/postgres # 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 0fdd37da7..29b2a86c4 100644 --- a/tests/functional/adapter/test_constraints.py +++ b/tests/functional/adapter/test_constraints.py @@ -8,6 +8,7 @@ BaseIncrementalConstraintsRuntimeDdlEnforcement, BaseIncrementalConstraintsRollback, BaseModelConstraintsRuntimeEnforcement, + BaseConstraintQuotedColumn, ) _expected_sql_redshift = """ @@ -121,3 +122,7 @@ def expected_sql(self): ) ; """ + + +class TestRedshiftConstraintQuotedColumn(BaseConstraintQuotedColumn): + pass From 749b65cffa0a0ab30903e65db68ef5d002344ac9 Mon Sep 17 00:00:00 2001 From: Michelle Ark Date: Tue, 6 Jun 2023 00:02:58 -0400 Subject: [PATCH 2/3] add expected_sql for TestRedshiftConstraintQuotedColumn --- tests/functional/adapter/test_constraints.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tests/functional/adapter/test_constraints.py b/tests/functional/adapter/test_constraints.py index b5e23ff33..a97c66bbd 100644 --- a/tests/functional/adapter/test_constraints.py +++ b/tests/functional/adapter/test_constraints.py @@ -128,4 +128,22 @@ def expected_sql(self): class TestRedshiftConstraintQuotedColumn(BaseConstraintQuotedColumn): - pass + @pytest.fixture(scope="class") + def expected_sql(self): + return """ +create table ( + id integer not null, + "from" text not null, + date_day text +) ; +insert into +( + select id, "from", date_day + from ( + select + 'blue' as "from", + 1 as id, + '2019-01-01' as date_day + ) as model_subq +); +""" From 8f3635f4357fd001e7f945c5716ddc36dca24aa6 Mon Sep 17 00:00:00 2001 From: Michelle Ark Date: Tue, 13 Jun 2023 15:44:36 -0400 Subject: [PATCH 3/3] revert dev-requirements.txt changes --- dev-requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 54f19e92d..e9e4083c5 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,8 +1,8 @@ # install latest changes in dbt-core + dbt-postgres # TODO: how to switch from HEAD to x.y.latest branches after minor releases? -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@jerco/7370-model-contracts-respect-quoting#egg=dbt-postgres&subdirectory=plugins/postgres +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#egg=dbt-postgres&subdirectory=plugins/postgres # if version 1.x or greater -> pin to major version # if version 0.x -> pin to minor