Previously if you set an invalid incremental_strategy for an incremental model, it'll succeed on the first run, and then fail on the second run
I.e. if you have
{{config(materialized="incremental", incremental_strategy="bad_strategy")}}
select * from {{ ref("input_model") }}
{% if is_incremental() %}
where event_time >= (select coalesce(max(event_time),'1900-01-01') from {{ this }} )
{% endif %}
That was always succeeding when the model was either built for the first time or rebuilt via --full-refresh. You only got an error about the strategy the next time the model was run.
Solution
Change the order of operations in incremental.sql to ensure that a incremental model's incremental_strategy is always validated
[X] I have run this code in development, and it appears to resolve the stated issue
[X] This PR includes tests, or tests are not required/relevant for this PR
[X] This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc.) or this PR has already received feedback and approval from Product or DX
resolves #330
Problem
Previously if you set an invalid
incremental_strategy
for an incremental model, it'll succeed on the first run, and then fail on the second run I.e. if you haveThat was always succeeding when the model was either built for the first time or rebuilt via --full-refresh. You only got an error about the strategy the next time the model was run.
Solution
Change the order of operations in
incremental.sql
to ensure that a incremental model'sincremental_strategy
is always validatedChecklist