-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'EqualExperts:master' into quoted-column-identifiers
- Loading branch information
Showing
26 changed files
with
303 additions
and
64 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{% macro ref() %} | ||
{{ return(dbt_unit_testing.ref(*varargs, **kwargs)) }} | ||
{% endmacro %} | ||
|
||
{% macro source() %} | ||
{{ return(dbt_unit_testing.source(*varargs, **kwargs)) }} | ||
{% endmacro %} |
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
4 changes: 2 additions & 2 deletions
4
integration-tests/models/model_b_references_model_with_builtin_ref.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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
select | ||
{{ dbt_utils.star(ref('model_in_database')) }}, | ||
{{ dbt_utils.star(source('dbt_unit_testing', 'sample_source_name')) }} | ||
{{ dbt_utils.star(builtins.ref('model_in_database')) }}, | ||
{{ dbt_utils.star(builtins.source('dbt_unit_testing', 'sample_source_name')) }} | ||
from {{ dbt_unit_testing.ref('model_in_database') }} | ||
left join {{ dbt_unit_testing.source('dbt_unit_testing', 'sample_source_name') }} on false |
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 @@ | ||
select * from {{ dbt_unit_testing.ref('dbt_unit_testing_sub_package', 'sub_package_model_a') }} where a >=1 |
3 changes: 3 additions & 0 deletions
3
integration-tests/models/model_references_model_with_version.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,3 @@ | ||
{% if dbt_unit_testing.version_bigger_or_equal_to("1.5.0") %} | ||
select * from {{ ref('model_with_version') }} where a > 0 | ||
{% endif %} |
3 changes: 3 additions & 0 deletions
3
integration-tests/models/model_references_model_with_version_1.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,3 @@ | ||
{% if dbt_unit_testing.version_bigger_or_equal_to("1.5.0") %} | ||
select * from {{ ref('model_with_version', v=1) }} where a > 1 | ||
{% endif %} |
4 changes: 4 additions & 0 deletions
4
integration-tests/models/model_references_model_with_version_2.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,4 @@ | ||
{% if dbt_unit_testing.version_bigger_or_equal_to("1.5.0") %} | ||
select * from {{ ref('model_with_version', version=2) }} where a > 2 | ||
{% endif %} | ||
|
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 @@ | ||
select 1 as a |
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 @@ | ||
select 2 as a |
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,8 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: model_with_version | ||
|
||
versions: | ||
- v: 1 | ||
- v: 2 |
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
17 changes: 17 additions & 0 deletions
17
integration-tests/tests/unit/model_b_references_subpackage.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,17 @@ | ||
{{ | ||
config( | ||
tags=['unit-test', 'bigquery', 'snowflake', 'postgres'] | ||
) | ||
}} | ||
|
||
{% call dbt_unit_testing.test('model_b_references_subpackage', 'sample test') %} | ||
{% call dbt_unit_testing.mock_ref ('dbt_unit_testing_sub_package', 'sub_package_model_a') %} | ||
select 0 as a, 'a' as b | ||
UNION ALL | ||
select 1 as a, 'b' as b | ||
{% endcall %} | ||
{% call dbt_unit_testing.expect() %} | ||
select 1 as a, 'b' as b | ||
{% endcall %} | ||
{% endcall %} | ||
|
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
43 changes: 43 additions & 0 deletions
43
integration-tests/tests/unit/model_references_model_with_version.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,43 @@ | ||
{{ | ||
config( | ||
tags=['unit-test', 'bigquery', 'snowflake', 'postgres', 'versioned', '1.5.4'] | ||
) | ||
}} | ||
|
||
{% call dbt_unit_testing.test('model_references_model_with_version', 'latest version') %} | ||
{% call dbt_unit_testing.mock_ref ('model_with_version') %} | ||
select 0 as a | ||
UNION ALL | ||
select 1234 as a | ||
{% endcall %} | ||
{% call dbt_unit_testing.expect() %} | ||
select 1234 as a | ||
{% endcall %} | ||
{% endcall %} | ||
|
||
UNION ALL | ||
|
||
{% call dbt_unit_testing.test('model_references_model_with_version_1', 'version 1') %} | ||
{% call dbt_unit_testing.mock_ref ('model_with_version', v=1) %} | ||
select 1 as a | ||
UNION ALL | ||
select 1234 as a | ||
{% endcall %} | ||
{% call dbt_unit_testing.expect() %} | ||
select 1234 as a | ||
{% endcall %} | ||
{% endcall %} | ||
|
||
UNION ALL | ||
|
||
{% call dbt_unit_testing.test('model_references_model_with_version_2', 'version 2') %} | ||
{% call dbt_unit_testing.mock_ref ('model_with_version', version=2) %} | ||
select 2 as a | ||
UNION ALL | ||
select 1234 as a | ||
{% endcall %} | ||
{% call dbt_unit_testing.expect() %} | ||
select 1234 as a | ||
{% endcall %} | ||
{% endcall %} | ||
|
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,27 @@ | ||
{{ | ||
config( | ||
tags=['unit-test', 'bigquery', 'snowflake', 'postgres', 'versioned', '1.5.4'] | ||
) | ||
}} | ||
|
||
{% call dbt_unit_testing.test('model_with_version', 'version 1', version=1) %} | ||
{% call dbt_unit_testing.expect() %} | ||
select 1 as a | ||
{% endcall %} | ||
{% endcall %} | ||
|
||
UNION ALL | ||
|
||
{% call dbt_unit_testing.test('model_with_version', 'version 2', v=2) %} | ||
{% call dbt_unit_testing.expect() %} | ||
select 2 as a | ||
{% endcall %} | ||
{% endcall %} | ||
|
||
UNION ALL | ||
|
||
{% call dbt_unit_testing.test('model_with_version', 'latest version') %} | ||
{% call dbt_unit_testing.expect() %} | ||
select 2 as a | ||
{% endcall %} | ||
{% endcall %} |
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
Oops, something went wrong.