Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for models which transition from views to incremental #1293

Merged
merged 2 commits into from
Feb 13, 2019

Conversation

drewbanin
Copy link
Contributor

Fixes #1292

If the target relation is a non-table (probably a view) then dbt should return False from the is_incremental() macro. The incremental materialization will drop this relation before running the model code as a create table as statement, so the incremental filter should not be applied
to the model sql.

Added a test which, before the code change, results in:

dbt: DEBUG: Postgres error: relation "test15500751307383_changing_relation_type_035.model" does not exist

If the target relation is a non-table (probably a view) then dbt
should return False from the is_incremental() macro. The
materialization will drop this relation before running the model
code as a `create table as` statement, so the incremental filter
would likely be invalid.
@drewbanin drewbanin merged commit cf873d0 into dev/stephen-girard Feb 13, 2019
@drewbanin drewbanin deleted the fix/incremental-from-view branch February 13, 2019 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants