-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade for v0.18.0 (utils, dispatch) (#97)
* Scope potential spark support * Use adapter.dispatch * Update is_adapter macro * Fixups, packages, readme * Rm wip spark vestiges * Rm whitespace additions * More ambitious lower utils bound
- Loading branch information
Showing
11 changed files
with
52 additions
and
65 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{% macro _get_snowplow_namespaces() %} | ||
{% set override_namespaces = var('snowplow_dispatch_list', []) %} | ||
{% do return(override_namespaces + ['snowplow']) %} | ||
{% 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,19 @@ | ||
{% macro set_default_adapters() %} | ||
|
||
{% set default_adapters = ['postgres', 'redshift', 'snowflake'] %} | ||
{% macro is_adapter(adapter_type='default') %} | ||
|
||
{% do return(default_adapters) %} | ||
{{ return(adapter.dispatch('is_adapter', packages = snowplow._get_snowplow_namespaces()) (adapter_type)) }} | ||
|
||
{% endmacro %} | ||
|
||
{% macro is_adapter(adapter='default') %} | ||
{% macro default__is_adapter(adapter_type='default') %} | ||
|
||
{#- | ||
This logic means that if you add your own macro named `set_default_adapters` | ||
to your project, that will be used, giving you the flexibility of overriding | ||
which target types use the default implementation of Snowplow models. | ||
-#} | ||
{% set result = (adapter_type == 'default') %} | ||
{{return(result)}} | ||
|
||
{% if context.get(ref.config.project_name, {}).get('set_default_adapters') %} | ||
{% set default_adapters=context[ref.config.project_name].set_default_adapters() %} | ||
{% else %} | ||
{% set default_adapters=snowplow.set_default_adapters() %} | ||
{% endif %} | ||
{% endmacro %} | ||
|
||
{% if adapter == 'default' %} | ||
{% set adapters = default_adapters %} | ||
{% elif adapter is string %} | ||
{% set adapters = [adapter] %} | ||
{% else %} | ||
{% set adapters = adapter %} | ||
{% endif %} | ||
|
||
{% set result = (target.type in adapters) %} | ||
|
||
{{return(result)}} | ||
{% macro bigquery__is_adapter(adapter_type='default') %} | ||
|
||
{% set result = (adapter_type == 'bigquery') %} | ||
{{return(result)}} | ||
|
||
{% 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
packages: | ||
- package: fishtown-analytics/dbt_utils | ||
version: [">=0.4.0", "<0.6.0"] | ||
version: [">=0.6.0", "<0.7.0"] |