-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1701 from fishtown-analytics/feature/expose-confi…
…g-in-generation-macros add configs to ParsedNodes before generating a schema/alias
- Loading branch information
Showing
6 changed files
with
79 additions
and
9 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
6 changes: 6 additions & 0 deletions
6
test/integration/024_custom_schema_test/custom-macros-configs/schema.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,6 @@ | ||
|
||
{% macro generate_schema_name(schema_name, node) %} | ||
|
||
{{ node.config['schema'] }}_{{ target.schema }}_macro | ||
|
||
{% 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
21 changes: 21 additions & 0 deletions
21
test/integration/043_custom_aliases_test/macros-configs/macros.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,21 @@ | ||
|
||
{#-- Verify that the config['alias'] key is present #} | ||
{% macro generate_alias_name(custom_alias_name, node) -%} | ||
{%- if custom_alias_name is none -%} | ||
{{ node.name }} | ||
{%- else -%} | ||
custom_{{ node.config['alias'] | trim }} | ||
{%- endif -%} | ||
{%- endmacro %} | ||
|
||
{% macro string_literal(s) -%} | ||
{{ adapter_macro('test.string_literal', s) }} | ||
{%- endmacro %} | ||
|
||
{% macro default__string_literal(s) %} | ||
'{{ s }}'::text | ||
{% endmacro %} | ||
|
||
{% macro bigquery__string_literal(s) %} | ||
cast('{{ s }}' as string) | ||
{% 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