Skip to content

Commit

Permalink
Merge pull request #1608 from fishtown-analytics/fix/is-incremental-c…
Browse files Browse the repository at this point in the history
…heck-materialization

Make is_incremental live up to its name
  • Loading branch information
drewbanin committed Jul 15, 2019
2 parents cc90b04 + 405748c commit 5a1f0bd
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 5a1f0bd

Please sign in to comment.