-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[backport #4070] fixed error_id typo
* fixed error_id typo and added tests * added changelog entry # Conflicts: # CHANGELOG.md
- Loading branch information
Showing
7 changed files
with
133 additions
and
3 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
37 changes: 37 additions & 0 deletions
37
test/integration/008_schema_tests_test/models-v2/limit_null/schema.yml
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,37 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: table_limit_null | ||
description: "The table has 1 null values, and we're okay with that, until it's more than 1." | ||
columns: | ||
- name: favorite_color_full_list | ||
description: "The favorite color" | ||
- name: count | ||
description: "The number of responses for this favorite color - purple will be null" | ||
tests: | ||
- not_null: | ||
error_if: '>1' | ||
warn_if: '>1' | ||
|
||
- name: table_warning_limit_null | ||
description: "The table has 1 null value, and we're okay with 1, but want to know of any." | ||
columns: | ||
- name: favorite_color_full_list | ||
description: "The favorite color" | ||
- name: count | ||
description: "The number of responses for this favorite color - purple will be null" | ||
tests: | ||
- not_null: | ||
error_if: '>1' | ||
|
||
- name: table_failure_limit_null | ||
description: "The table has some 2 null values, and that's not ok. Warn and error." | ||
columns: | ||
- name: favorite_color_full_list | ||
description: "The favorite color" | ||
- name: count | ||
description: "The number of responses for this favorite color - purple will be null" | ||
tests: | ||
- not_null: | ||
error_if: '>1' | ||
|
11 changes: 11 additions & 0 deletions
11
test/integration/008_schema_tests_test/models-v2/limit_null/table_failure_limit_null.sql
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,11 @@ | ||
{{ | ||
config( | ||
materialized='table' | ||
) | ||
}} | ||
|
||
select * from {{ref('table_limit_null')}} | ||
|
||
UNION ALL | ||
|
||
select 'magenta' as favorite_color_full_list, null as count |
13 changes: 13 additions & 0 deletions
13
test/integration/008_schema_tests_test/models-v2/limit_null/table_limit_null.sql
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,13 @@ | ||
{{ | ||
config( | ||
materialized='table' | ||
) | ||
}} | ||
|
||
select favorite_color as favorite_color_full_list, count(*) as count | ||
from {{ this.schema }}.seed | ||
group by 1 | ||
|
||
UNION ALL | ||
|
||
select 'purple' as favorite_color_full_list, null as count |
7 changes: 7 additions & 0 deletions
7
test/integration/008_schema_tests_test/models-v2/limit_null/table_warning_limit_null.sql
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 @@ | ||
{{ | ||
config( | ||
materialized='table' | ||
) | ||
}} | ||
|
||
select * from {{ref('table_limit_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