Skip to content

Commit 9fc7168

Browse files
author
Even Wei
authored
Merge pull request #103 from DataRecce/docs/state-modified-flag-caveat
docs(setup): caveat state_modified_compare_more_unrendered_values
2 parents 6b6e169 + 4ace2f1 commit 9fc7168

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

docs/setup-guides/environment-best-practices.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,19 @@ Unchanged models are resolved from production via `--defer`, so you only pay for
6464

6565
For many projects, this is the complete setup.
6666

67+
!!! warning "Set `state_modified_compare_more_unrendered_values` if your configs reference environment values"
68+
By default, dbt's `state:modified` compares **rendered** config values. Configs like `incremental_predicates`, `unique_key`, or `partition_by` often contain environment-aware Jinja such as `{{ this }}`, `{{ target.schema }}`, or env vars. Those configs render to different values across base and current environments, so dbt flags the model as modified and Recce surfaces it as altered — even though the source code is identical.
69+
70+
Enable the [`state_modified_compare_more_unrendered_values`](https://docs.getdbt.com/reference/global-configs/behavior-changes#source-definitions-for-statemodified) flag (dbt >= 1.9) so dbt compares the unrendered Jinja source instead:
71+
72+
```yaml
73+
# dbt_project.yml
74+
flags:
75+
state_modified_compare_more_unrendered_values: true
76+
```
77+
78+
Both base and current manifests must be built with the flag enabled — rebuild your base artifacts if they predate this change, or `state:modified` will keep producing false positives.
79+
6780
## Keep Your Base Environment Current
6881

6982
The base environment can become outdated in two scenarios:

0 commit comments

Comments
 (0)