-
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 pull request #33 from wusanny/my_new_branch
My new branch
- Loading branch information
Showing
8 changed files
with
52 additions
and
3 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 |
---|---|---|
|
@@ -61,4 +61,4 @@ models: | |
# warn_error_options: | ||
# include: # Previously called "include" | ||
# - NoNodesForSelectionCriteria | ||
|
||
|
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,40 @@ | ||
{% macro generate_alias_name(custom_alias_name=none, node=none) -%} | ||
|
||
{%- if custom_alias_name is none -%} | ||
|
||
{% set tier_folder_name = node.fqn[1] %} | ||
{% set function_folder_name = node.fqn[2] %} | ||
{% set model_name = node.name %} | ||
{% set schema_name = node.config.get('schema') %} | ||
|
||
{# | ||
2. Generate the alias name based on the target name. | ||
(1) For "deploy" target: | ||
Use the model name as the table name | ||
Examples: | ||
a. <schema>.client_private_api_crud_requests | ||
b. <schema>.marketing_contribution | ||
b. <schema>.adv_filter_use_by_base_day | ||
(2) For "dev", "development", "default", "ci" targets: | ||
The table name is prefixed with the tier/function folder name, and suffixed with value of env "DBT_DEV_TABLE_SUFFIX" | ||
Examples: | ||
a. ds_dev.<schema>__client_private_api_crud_requests{DBT_DEV_TABLE_SUFFIX} | ||
b. ds_dev.<schema>__marketing_contribution{DBT_DEV_TABLE_SUFFIX} | ||
b. ds_dev.<schema>__adv_filter_use_by_base_day{DBT_DEV_TABLE_SUFFIX} | ||
(3) For all other targets, raise an error | ||
#} | ||
{% if target.name == 'deploy' %} | ||
{% set destination_model_name = model_name -%} | ||
{% elif target.name == 'dev' or target.name == 'development' or target.name == 'default' or target.name == 'ci' %} | ||
{% set destination_model_name = schema_name ~ '__' ~ model_name -%} | ||
{% else %} | ||
{% do exceptions.warn("Invalid `target` in generate_alias_name macro. Got: " ~ target.name) %} | ||
{% endif %} | ||
{%- else -%} | ||
{% set destination_model_name = custom_alias_name | trim -%} | ||
{%- endif -%} | ||
|
||
{{ log("model " ~ node.fqn[1:] ~ " will be created as: " ~ destination_model_name, info=True) }} | ||
{{ destination_model_name }} | ||
|
||
{%- 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 @@ | ||
select * from {{ref("foo")}} |
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 @@ | ||
select 1 as id |
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,8 @@ | ||
version: 2 | ||
|
||
sources: | ||
- name: dbt_sprawira | ||
database: development | ||
schema: dbt_sprawira | ||
tables: | ||
- name: dev_source |
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 @@ | ||
select system$wait(240) as c |
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,3 @@ | ||
packages: | ||
- package: dbt-labs/dbt_utils | ||
version: 1.1.1 | ||
sha1_hash: a158c48c59c2bb7d729d2a4e215aabe5bb4f3353 |