-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix --store-failures * Add chnagelog entry * Maybe this? * Fix indentation * Class inheritance, silly
- Loading branch information
Showing
5 changed files
with
72 additions
and
2 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
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,9 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: view_model | ||
columns: | ||
- name: id | ||
tests: | ||
- unique | ||
- not_null |
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,5 @@ | ||
select 1 as id | ||
union all | ||
select 1 as id | ||
union all | ||
select null as id |
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,51 @@ | ||
from test.custom.base import DBTSparkIntegrationTest, use_profile | ||
|
||
class TestStoreFailures(DBTSparkIntegrationTest): | ||
@property | ||
def schema(self): | ||
return "store_failures" | ||
|
||
@property | ||
def models(self): | ||
return "models" | ||
|
||
@property | ||
def project_config(self): | ||
return { | ||
'config-version': 2, | ||
'tests': { | ||
'+store_failures': True, | ||
'+severity': 'warn', | ||
} | ||
} | ||
|
||
def test_store_failures(self): | ||
self.run_dbt(['run']) | ||
results = self.run_dbt(['test', '--store-failures'], strict = False) | ||
|
||
class TestStoreFailuresApacheSpark(TestStoreFailures): | ||
|
||
@use_profile("apache_spark") | ||
def test_store_failures_apache_spark(self): | ||
self.test_store_failures() | ||
|
||
class TestStoreFailuresDelta(TestStoreFailures): | ||
|
||
@property | ||
def project_config(self): | ||
return { | ||
'config-version': 2, | ||
'tests': { | ||
'+store_failures': True, | ||
'+severity': 'warn', | ||
'+file_format': 'delta', | ||
} | ||
} | ||
|
||
@use_profile("databricks_cluster") | ||
def test_store_failures_databricks_cluster(self): | ||
self.test_store_failures() | ||
|
||
@use_profile("databricks_sql_endpoint") | ||
def test_store_failures_databricks_sql_endpoint(self): | ||
self.test_store_failures() |