-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change relation matching to case-insensitive
- Loading branch information
1 parent
e9194b1
commit 537e38e
Showing
4 changed files
with
112 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
kind: Fixes | ||
body: Ignore case when matching relations | ||
time: 2022-10-02T08:16:03.70013648Z | ||
custom: | ||
Author: bachng2017 | ||
Issue: "140" | ||
PR: "141" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
seed_csv = """ | ||
id,value | ||
1,1 | ||
2,2 | ||
3,3 | ||
4,4 | ||
""".lstrip() | ||
|
||
table_model = """ | ||
select * from {{ ref('seed') }} | ||
""" | ||
|
||
table_profile_yml = """ | ||
version: 2 | ||
models: | ||
- name: table_model | ||
columns: | ||
- name: id | ||
tests: | ||
- unique | ||
- not_null | ||
- name: value | ||
quote: true | ||
tests: | ||
- not_null | ||
- accepted_values: | ||
values: | ||
- 1 | ||
- 2 | ||
- 3 | ||
- 4 | ||
quote: false | ||
seeds: | ||
- name: seed | ||
columns: | ||
- name: id | ||
- name: value | ||
tests: | ||
- not_null | ||
""" |
59 changes: 59 additions & 0 deletions
59
tests/functional/adapter/store_failures/test_store_failures.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import pytest | ||
from dbt.tests.util import run_dbt | ||
|
||
from tests.functional.adapter.store_failures.fixtures import ( | ||
seed_csv, | ||
table_model, | ||
table_profile_yml, | ||
) | ||
|
||
|
||
class TestStoreFailuresTable: | ||
@property | ||
def schema(self): | ||
return "default" | ||
|
||
# everything that goes in the "seeds" directory | ||
@pytest.fixture(scope="class") | ||
def seeds(self): | ||
return { | ||
"seed.csv": seed_csv, | ||
} | ||
|
||
@pytest.fixture(scope="class") | ||
def project_config_update(self): | ||
return { | ||
"name": "store_failures_tests", | ||
"quoting": { | ||
"database": False, | ||
"schema": False, | ||
"identifier": True, | ||
}, | ||
"models": { | ||
"+materialized": "table", | ||
}, | ||
"tests": { | ||
"+store_failures": True, | ||
}, | ||
} | ||
|
||
# everything that goes in the "models" directory | ||
@pytest.fixture(scope="class") | ||
def models(self): | ||
return { | ||
"table_model.sql": table_model, | ||
"table_store_failures.yml": table_profile_yml, | ||
} | ||
|
||
def test_run_seed_test(self, project): | ||
# seed seeds | ||
results = run_dbt(["seed"], expect_pass=True) | ||
assert len(results) == 1 | ||
results = run_dbt(["run"], expect_pass=True) | ||
assert len(results) == 1 | ||
# test tests | ||
results = run_dbt(["test"], expect_pass=True) | ||
assert len(results) == 5 | ||
# test tests 2nd times | ||
results = run_dbt(["test"], expect_pass=True) | ||
assert len(results) == 5 |