From 8ad8d9e59ad43aaa5760439a05d9ec63721f8b5c Mon Sep 17 00:00:00 2001 From: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> Date: Thu, 24 Oct 2024 10:42:29 -0400 Subject: [PATCH] Disclaimer on statem modified behavior change --- .../docs/reference/global-configs/behavior-changes.md | 9 ++++++++- .../reference/node-selection/state-comparison-caveats.md | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/website/docs/reference/global-configs/behavior-changes.md b/website/docs/reference/global-configs/behavior-changes.md index ae109b8f7c7..3a0173f8db7 100644 --- a/website/docs/reference/global-configs/behavior-changes.md +++ b/website/docs/reference/global-configs/behavior-changes.md @@ -83,13 +83,20 @@ Set the `skip_nodes_if_on_run_start_fails` flag to `True` to skip all selected r ### Source definitions for state:modified +```note + +The state directory needs to be built with v1.9 or higher [Versionless](/docs/dbt-versions/versionless-cloud) dbt Cloud along with `state_modified_compare_more_unrendered_values: true` within your dbt_project.yml. + +If the state directory was built with an older version or if the `state_modified_compare_more_unrendered_values` behavior change flag was not set (or set to '`false`), you need to rebuild it to avoid false positives during state comparison with `state:modified`. + +``` + The flag is `False` by default. Set `state_modified_compare_more_unrendered_values` to `True` to reduce false positives during `state:modified` checks (especially when configs differ by target environment like `prod` vs. `dev`). Setting the flag to `True` changes the `state:modified` comparison from using rendered values to unrendered values instead. It accomplishes this by persisting `unrendered_config` during model parsing and `unrendered_database` and `unrendered_schema` configs during source parsing. - ### Package override for built-in materialization Setting the `require_explicit_package_overrides_for_builtin_materializations` flag to `True` prevents this automatic override. diff --git a/website/docs/reference/node-selection/state-comparison-caveats.md b/website/docs/reference/node-selection/state-comparison-caveats.md index 25301656539..a3e2037eae1 100644 --- a/website/docs/reference/node-selection/state-comparison-caveats.md +++ b/website/docs/reference/node-selection/state-comparison-caveats.md @@ -48,6 +48,10 @@ dbt test -s "state:modified" --exclude "test_name:relationships" To reduce false positives during `state:modified` selection due to env-aware logic, you can set the `state_modified_compare_more_unrendered_values` [behavior flag](/reference/global-configs/behavior-changes#behavior-change-flags) to `True`. +The state directory needs to be built with v1.9 or higher [Versionless](/docs/dbt-versions/versionless-cloud) dbt Cloud along with `state_modified_compare_more_unrendered_values: true` within your dbt_project.yml. + +If the state directory was built with an older version or if the `state_modified_compare_more_unrendered_values` behavior change flag was not set (or set to '`false`), you need to rebuild it to avoid false positives during state comparison with `state:modified`. +