-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove old deprecation tests Add new tests Fix all the integration tests that do manifest things
- Loading branch information
Jacob Beck
committed
Feb 24, 2020
1 parent
e571cba
commit 5030509
Showing
20 changed files
with
296 additions
and
170 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
28 changes: 28 additions & 0 deletions
28
core/dbt/include/global_project/macros/etc/get_custom_database.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,28 @@ | ||
{# | ||
Renders a database name given a custom database name. If the custom | ||
database name is none, then the resulting database is just the "database" | ||
value in the specified target. If a database override is specified, then | ||
the resulting database is the default database concatenated with the | ||
custom database. | ||
|
||
This macro can be overriden in projects to define different semantics | ||
for rendering a database name. | ||
|
||
Arguments: | ||
custom_database_name: The custom database name specified for a model, or none | ||
node: The node the database is being generated for | ||
|
||
#} | ||
{% macro generate_database_name(custom_database_name=none, node=none) -%} | ||
{%- set default_database = target.database -%} | ||
{%- if custom_database_name is none -%} | ||
|
||
{{ default_database }} | ||
|
||
{%- else -%} | ||
|
||
{{ custom_database_name }} | ||
|
||
{%- endif -%} | ||
|
||
{%- 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
15 changes: 13 additions & 2 deletions
15
test/integration/006_simple_dependency_test/local_dependency/macros/generate_schema_name.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,4 +1,15 @@ | ||
{# This should be ignored as it's in a subpackage #} | ||
{% macro generate_schema_name(custom_schema_name=none) -%} | ||
invalid_schema_name | ||
{% macro generate_schema_name(custom_schema_name=none, node=none) -%} | ||
{{ exceptions.raise_compiler_error('invalid', node=node) }} | ||
{%- endmacro %} | ||
|
||
{# This should be ignored as it's in a subpackage #} | ||
{% macro generate_database_name(custom_database_name=none, node=none) -%} | ||
{{ exceptions.raise_compiler_error('invalid', node=node) }} | ||
{%- endmacro %} | ||
|
||
|
||
{# This should be ignored as it's in a subpackage #} | ||
{% macro generate_alias_name(custom_alias_name=none, node=none) -%} | ||
{{ exceptions.raise_compiler_error('invalid', node=node) }} | ||
{%- endmacro %} |
7 changes: 0 additions & 7 deletions
7
test/integration/012_deprecation_tests/deprecated-macros/schema.sql
This file was deleted.
Oops, something went wrong.
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
10 changes: 10 additions & 0 deletions
10
test/integration/024_custom_schema_test/custom-db-macros/custom_db.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,10 @@ | ||
|
||
{% macro generate_database_name(database_name, node) %} | ||
{% if database_name == 'alt' %} | ||
{{ env_var('SNOWFLAKE_TEST_ALT_DATABASE') }} | ||
{% elif database_name %} | ||
{{ database_name }} | ||
{% else %} | ||
{{ target.database }} | ||
{% endif %} | ||
{% 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
|
||
select * from {{ target.schema }}.seed |
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,2 @@ | ||
{{ config(database='alt') }} | ||
select * from {{ ref('view_1') }} |
30 changes: 30 additions & 0 deletions
30
test/integration/024_custom_schema_test/db-models/view_3.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,30 @@ | ||
|
||
{{ config(database='alt', materialized='table') }} | ||
|
||
|
||
with v1 as ( | ||
|
||
select * from {{ ref('view_1') }} | ||
|
||
), | ||
|
||
v2 as ( | ||
|
||
select * from {{ ref('view_2') }} | ||
|
||
), | ||
|
||
combined as ( | ||
|
||
select last_name from v1 | ||
union all | ||
select last_name from v2 | ||
|
||
) | ||
|
||
select | ||
last_name, | ||
count(*) as count | ||
|
||
from combined | ||
group by 1 |
Oops, something went wrong.