This file contains hidden or 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 is overriding the default macro to support our specialized incremental runs #} | |
{# this first macro is just a mirror of the default should_full_refresh logic | |
which can be found in the dbt-snowflake adaptor repo #} | |
{% macro is_full_refresh_flagged() %} | |
{% set raw_config_full_refresh = config.get('full_refresh') %} | |
{% if raw_config_full_refresh is none %} | |
{% set raw_config_full_refresh = flags.FULL_REFRESH %} | |
{% endif %} |
This file contains hidden or 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
{% macro enhanced_incremental_filters(ref_timestamp, this_timestamp, day_overwrite=false) %} | |
{% if target.name in var('dev_targets') %} | |
and {{ ref_timestamp }} >= dateadd(d, -{{ var('testing_days_of_data') }}, current_date) | |
{% elif is_incremental() and not is_full_refresh_flagged() %} | |
{% if day_overwrite %} | |
and {{ ref_timestamp }} > (select dateadd(day, -1, max({{ this_timestamp }})) from {{ this }}) | |
{% else %} | |
and {{ ref_timestamp }} >= (select max({{ this_timestamp }}) from {{ this }}) | |
{% endif %} |
This file contains hidden or 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 is overriding the default macro to support our specialized incremental runs #} | |
{# this first macro is just a mirror of the default should_full_refresh logic | |
which can be found in the dbt-snowflake adaptor repo #} | |
{% macro is_full_refresh_flagged() %} | |
{% set raw_config_full_refresh = config.get('full_refresh') %} | |
{% if raw_config_full_refresh is none %} | |
{% set raw_config_full_refresh = flags.FULL_REFRESH %} | |
{% endif %} |
This file contains hidden or 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
{{ | |
config( | |
materialized='incremental', | |
unique_key='date_day', | |
cold_storage=true | |
) | |
}} | |
with |
This file contains hidden or 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
#!/usr/bin/env bash | |
DBT_ENV=~/.virtualenvs/dbt | |
DBT_BETA_ENV=~/.virtualenvs/dbt-beta | |
process_environment() { | |
env=$1 | |
release=$2 | |
if [[ -d "$env" ]]; then |