Skip to content

Commit

Permalink
make is_incremental live up to its name
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbanin committed Jul 15, 2019
1 parent cc90b04 commit 405748c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
{{ return(False) }}
{% else %}
{% set relation = adapter.get_relation(this.database, this.schema, this.table) %}
{{ return(relation is not none and relation.type == 'table' and not flags.FULL_REFRESH) }}
{{ return(relation is not none
and relation.type == 'table'
and model.config.materialized == 'incremental'
and not flags.FULL_REFRESH) }}
{% endif %}
{% endmacro %}
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@
}}

select * from {{ this.schema }}.seed

{% if is_incremental() %}
{% do exceptions.raise_compiler_error("is_incremental() evaluated to True in a table") %}
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@
}}

select * from {{ this.schema }}.seed

{% if is_incremental() %}
{% do exceptions.raise_compiler_error("is_incremental() evaluated to True in a view") %}
{% endif %}

0 comments on commit 405748c

Please sign in to comment.