-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #104 from saraburns1/saraburns1_datatest_maint
test: Fix data tests
- Loading branch information
Showing
10 changed files
with
80 additions
and
72 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
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
packages: | ||
- package: dbt-labs/codegen | ||
version: 0.11.0 | ||
- package: dbt-labs/dbt_utils | ||
version: 1.1.0 | ||
sha1_hash: 97b4306bc75da556cd002412ddf08f036472221b | ||
- package: dbt-labs/codegen | ||
version: 0.12.1 | ||
- package: dbt-labs/dbt_utils | ||
version: 1.1.1 | ||
sha1_hash: d974113b0f072cce35300077208f38581075ab40 |
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,34 @@ | ||
{% test accepted_values_xapi(model, column_name, values, table, quote=True) %} | ||
|
||
with all_values as ( | ||
|
||
select distinct | ||
{{ column_name }} as value_field | ||
|
||
from {{ table }} | ||
|
||
), | ||
|
||
validation_errors as ( | ||
|
||
select | ||
value_field | ||
|
||
from all_values | ||
where value_field not in ( | ||
{% for value in values -%} | ||
{% if quote -%} | ||
'{{ value }}' | ||
{%- else -%} | ||
{{ value }} | ||
{%- endif -%} | ||
{%- if not loop.last -%},{%- endif %} | ||
{%- endfor %} | ||
) | ||
|
||
) | ||
|
||
select * | ||
from validation_errors | ||
|
||
{% endtest %} |