forked from dbt-labs/dbt-utils
-
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.
Merge branch 'dev/0.6.0' into date_spine_docs
- Loading branch information
Showing
35 changed files
with
180 additions
and
122 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,47 @@ | ||
# dbt-utils v0.6.0 (unreleased) | ||
# dbt-utils v0.6.0 | ||
|
||
## Fixes | ||
## Breaking changes | ||
- :rotating_light: dbt v0.18.0 or greater is required for this release. If you are not ready to upgrade, consider using a previous release of this package | ||
- :rotating_light: The `get_tables_by_prefix`, `union_tables` and `get_tables_by_pattern` macros have been removed | ||
|
||
## Migration instructions | ||
- Upgrade your dbt project to v0.18.0 using [these instructions](https://discourse.getdbt.com/t/prerelease-v0-18-0-marian-anderson/1545). | ||
- Upgrade your `packages.yml` file to use version `0.6.0` of this package. Run `dbt clean` and `dbt deps`. | ||
- If your project uses the `get_tables_by_prefix` macro, replace it with `get_relations_by_prefix`. All arguments have retained the same name. | ||
- If your project uses the `union_tables` macro, replace it with `union_relations`. While the order of arguments has stayed consistent, the `tables` argument has been renamed to `relations`. Further, the default value for the `source_column_name` argument has changed from `'_dbt_source_table'` to `'_dbt_source_relation'` — you may want to explicitly define this argument to avoid breaking changes. | ||
|
||
``` | ||
-- before: | ||
{{ dbt_utils.union_tables( | ||
tables=[ref('my_model'), source('my_source', 'my_table')], | ||
exclude=["_loaded_at"] | ||
) }} | ||
-- after: | ||
{{ dbt_utils.union_relations( | ||
relations=[ref('my_model'), source('my_source', 'my_table')], | ||
exclude=["_loaded_at"], | ||
source_column_name='_dbt_source_table' | ||
) }} | ||
``` | ||
- If your project uses the `get_tables_by_pattern` macro, replace it with `get_tables_by_pattern_sql` — all arguments are consistent. | ||
|
||
## Features | ||
|
||
* Switch usage of `adapter_macro` to `adapter.dispatch`, and define `dbt_utils_dispatch_list`, | ||
enabling users of community-supported database plugins to add or override macro implementations | ||
specific to their database ([#267](https://github.com/fishtown-analytics/dbt-utils/pull/267)) | ||
* Use `add_ephemeral_prefix` instead of hard-coding a string literal, to support | ||
database adapters that use different prefixes ([#267](https://github.com/fishtown-analytics/dbt-utils/pull/267)) | ||
* Implement a quote_columns argument in the unique_combination_of_columns schema test ([#270](https://github.com/fishtown-analytics/dbt-utils/pull/270) [@JoshuaHuntley](https://github.com/JoshuaHuntley)) | ||
|
||
## Quality of life | ||
* Remove deprecated macros `get_tables_by_prefix` and `union_tables` ([#268](https://github.com/fishtown-analytics/dbt-utils/pull/268)) | ||
* Remove `get_tables_by_pattern` macro, which is equivalent to the `get_tables_by_pattern_sql` macro (the latter has a more logical name) ([#268](https://github.com/fishtown-analytics/dbt-utils/pull/268)) | ||
|
||
# dbt-utils v0.5.1 | ||
|
||
## Fixes | ||
|
||
## Features | ||
|
||
## Quality of life | ||
* Improve release process, and fix tests (#251) | ||
* Make deprecation warnings more useful (#258 @tayloramurphy) | ||
* Add more docs for `date_spine` (#265 @calvingiles) | ||
* Improve release process, and fix tests ([#251](https://github.com/fishtown-analytics/dbt-utils/pull/251)) | ||
* Make deprecation warnings more useful ([#258](https://github.com/fishtown-analytics/dbt-utils/pull/258) [@tayloramurphy](https://github.com/tayloramurphy)) | ||
* Add more docs for `date_spine` ([#265](https://github.com/fishtown-analytics/dbt-utils/pull/265) [@calvingiles](https://github.com/calvingiles)) |
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,4 +1,4 @@ | ||
{{ config(materialized = 'table') }} | ||
|
||
{% set relations = dbt_utils.get_relations_by_pattern(target.schema, 'data_events_') %} | ||
{% set relations = dbt_utils.get_relations_by_pattern(target.schema, 'data_events_%') %} | ||
{{ dbt_utils.union_relations(relations) }} |
4 changes: 0 additions & 4 deletions
4
integration_tests/models/sql/test_get_tables_by_prefix_and_union.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{% macro _get_utils_namespaces() %} | ||
{% set override_namespaces = var('dbt_utils_dispatch_list', []) %} | ||
{% do return(override_namespaces + ['dbt_utils']) %} | ||
{% 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
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,23 @@ | ||
|
||
|
||
{% macro concat(fields) -%} | ||
{{ adapter_macro('dbt_utils.concat', fields) }} | ||
{{ adapter.dispatch('concat', packages = dbt_utils._get_utils_namespaces())(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)}} | ||
{{ dbt_utils.alternative_concat(fields) }} | ||
{% endmacro %} | ||
|
||
|
||
{% macro snowflake__concat(fields) %} | ||
{{dbt_utils.alternative_concat(fields)}} | ||
{{ dbt_utils.alternative_concat(fields) }} | ||
{% 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
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
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
Oops, something went wrong.