Conversation
Null folder placeholders were treated as legacy bare config values, so changing them made every sibling under the parent look state:modified.
|
Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA. In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, please reach out through a comment on this PR. CLA has not been signed by users: @wilu222 |
There was a problem hiding this comment.
🔵 Needs a closer look
Wrap the test signature exceeding the configured 99-character line length.
Pull request overview
Fixes false state:modified selections caused by null-valued keys in dbt_project.yml.
Changes:
- Ignores unprefixed null hierarchy placeholders.
- Preserves scalar and explicit
+-prefixed null configs. - Adds regression tests and a changelog entry.
File summaries
| File | Summary |
|---|---|
tests/unit/context/test_context_config.py |
Adds regression coverage. |
core/dbt/context/context_config.py |
Skips null hierarchy placeholders during config extraction. |
.changes/unreleased/Fixes-20260911-214018.yaml |
Documents the fix. |
Review details
Suppressed comments (1)
tests/unit/context/test_context_config.py:8
- This new signature is 108 characters, exceeding dbt-core's configured Black line length of 99, so the code-quality formatter will reject or rewrite this file. Please wrap the signature across lines.
def _project_config_levels(model_configs: Dict[str, Any], fqn: List[str]) -> List[Dict[str, Any]]:
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
|
This line is 98 characters; black’s limit in this repo is 99. Black already passed locally and left it as one line. Copilot's 108 count looks off. No wrap needed unless a maintainer prefers it. |
Resolves #16290
Problem
If a key in the
dbt_project.ymlmodel tree has a null value (e.g.beta:with no children or configs), any change to that key causedstate:modifiedto select every model beneath the parent block, including unrelated siblings.Root cause:
_project_configstreated any non-dict value as a legacy bare config. YAML null parses asNone, which is not a dict, so the placeholder key was copied into every sibling'sunrendered_configand then compared bysame_contents.Solution
Skip
Nonevalues in the legacy bare-config branch so null hierarchy placeholders are not treated as config, while still supporting bare scalars (materialized: view) and+-prefixed explicit nulls (+enabled: null).Adds unit regression coverage in
tests/unit/context/test_context_config.py.Checklist