forked from dbt-labs/dbt-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Tidy up changelog * Add 0.7.0 entry to changelog * Add order_by argument to get_column_values (dbt-labs#349) * Add slugify macro to utils, use in pivot macro (dbt-labs#314) * 0.20.0 compatibility (dbt-labs#371) * Explicitly redefine Redshift -> default * Upgrade generic tests * Rm namespaces macro. New dispatch syntax * Run tests with 0.20.0rc1 * Update changelog, readme Co-authored-by: Jeremy Cohen <jeremy@fishtownanalytics.com> * Simplify concat (dbt-labs#373) * Postgres also have an alternative concat binary operation (dbt-labs#296) * Update default implementation of concat macro Co-authored-by: Christophe Duong <christophe.duong@gmail.com> Co-authored-by: Jeremy Cohen <jeremy@fishtownanalytics.com> Co-authored-by: Christophe Duong <christophe.duong@gmail.com>
- Loading branch information
1 parent
0e00fb5
commit a729044
Showing
77 changed files
with
419 additions
and
333 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
|
||
{% macro test_assert_equal(model, actual, expected) %} | ||
select count(*) from {{ model }} where {{ actual }} != {{ expected }} | ||
{% test assert_equal(model, actual, expected) %} | ||
select * from {{ model }} where {{ actual }} != {{ expected }} | ||
|
||
{% endmacro %} | ||
{% endtest %} | ||
|
||
|
||
{% macro test_not_empty_string(model, arg) %} | ||
{% test not_empty_string(model, column_name) %} | ||
|
||
{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %} | ||
select * from {{ model }} where {{ column_name }} = '' | ||
|
||
select count(*) from {{ model }} where {{ column_name }} = '' | ||
|
||
{% endmacro %} | ||
{% endtest %} |
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
File renamed without changes.
File renamed without changes.
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 @@ | ||
{% if dbt_utils.slugify('!Hell0 world-hi') == 'hell0_world_hi' %} | ||
{# Return 0 rows for the test to pass #} | ||
select 1 limit 0 | ||
{% else %} | ||
{# Return >0 rows for the test to fail #} | ||
select 1 | ||
{% endif %} |
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
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,23 +1,9 @@ | ||
|
||
|
||
{% macro concat(fields) -%} | ||
{{ return(adapter.dispatch('concat', packages = dbt_utils._get_utils_namespaces())(fields)) }} | ||
{{ return(adapter.dispatch('concat', 'dbt_utils')(fields)) }} | ||
{%- endmacro %} | ||
|
||
{% macro default__concat(fields) -%} | ||
concat({{ fields|join(', ') }}) | ||
{%- endmacro %} | ||
|
||
{% macro alternative_concat(fields) %} | ||
{{ fields|join(' || ') }} | ||
{% endmacro %} | ||
|
||
|
||
{% macro redshift__concat(fields) %} | ||
{{ dbt_utils.alternative_concat(fields) }} | ||
{% endmacro %} | ||
|
||
|
||
{% macro snowflake__concat(fields) %} | ||
{{ dbt_utils.alternative_concat(fields) }} | ||
{% endmacro %} | ||
{%- endmacro %} |
Oops, something went wrong.