Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test dbt-core#7537 #602

Merged
merged 4 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
21 changes: 21 additions & 0 deletions tests/functional/adapter/test_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
BaseIncrementalConstraintsRuntimeDdlEnforcement,
BaseIncrementalConstraintsRollback,
BaseModelConstraintsRuntimeEnforcement,
BaseConstraintQuotedColumn,
)


Expand Down Expand Up @@ -129,3 +130,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 <model_identifier> (
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
);
"""