Skip to content

[Bug] unrendered config doesn't show raw value for configs set in the model's .yml file #11804

@dbernett-spring

Description

@dbernett-spring

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

If I define the severity (or really any config, severity is just an example) as follows in the dbt_project.yml:

data_tests:
  +severity: "{{ var('default_test_severity', env_var('DEFAULT_TEST_SEVERITY', 'error')) }}"

Then the unrendered_config for each test appears as follows in the manifest.json:

"unrendered_config": {
    "store_failures": true,
    "store_failures_as": "view",
    "limit": 1000,
    "severity": "{{ var('default_test_severity', env_var('DEFAULT_TEST_SEVERITY', 'error')) }}"
}

However, if I define the severity using the exact same logic, but put it in a particular model's .yml file, e.g.,:

data_tests:
  - not_null:
      config:
        severity: "{{ var('default_test_severity', env_var('DEFAULT_TEST_SEVERITY', 'error')) }}"

Then the unrendered_config for that test appears as follows in the manifest.json:

"unrendered_config": {
    "store_failures": true,
    "store_failures_as": "view",
    "limit": 1000,
    "severity": "ERROR"
}

Expected Behavior

I would expect that, regardless of whether I put this logic in the dbt_project.yml or in my_model.yml the unrendered config to look like the first version above.

This is important when using state_modified with the state_modified_compare_more_unrendered_values flag. If the unrendered_config looks like the second version above, then the test will be considered "modified" when using -s state:modified even though nothing has changed.

Obviously if we wanted to apply this to all tests or to entire directories, we could simply define the config in the dbt_project.yml, but if we need to apply it to specific models, that becomes less useful.

Steps To Reproduce

See above.

Relevant log output

Environment

- OS: MacOS 15.5 (24F74)
- Python: 3.12.11
- dbt: 1.9.4

Which database adapter are you using with dbt?

snowflake

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions