A developer is building an incremental model fct_orders.sql and adds the following block:
{% if is_incremental() %}
WHERE updated_at > (SELECT MAX(updated_at) FROM {{ this }})
{% endif %}
The developer runs dbt run --full-refresh. What does is_incremental() evaluate to during this run?
- A. True, but the WHERE clause is ignored because dbt detects the
--full-refreshflag - B. It raises a compilation error because
--full-refreshis incompatible withis_incremental() - C. False, because
--full-refreshforces a full rebuild and the macro returns false✓ Correct - D. True, because the model is configured as incremental
Explanation
is_incremental() returns False when the --full-refresh flag is used, when the model does not yet exist in the warehouse, or when dbt is running in a context that requires a full build. In all these cases, the WHERE filter block is skipped and the full dataset is loaded. The macro does not raise an error — it simply evaluates to false. There is no mechanism where the clause is 'ignored' separately from is_incremental() evaluating to false; the false evaluation IS the mechanism.