dbt-labs/dbt-core · error

relation config needs to be Snowflake model

Error message

relation config needs to be Snowflake model

What it means

Invariant expect in from_local_config (RefreshWarehouse component): the relation config downcast to DbtModel succeeded, but its snowflake_attr block is None even though a Snowflake model must always carry Snowflake-specific attributes. Fires when a Snowflake refresh_warehouse config is read off a model node lacking Snowflake attributes — an internal state inconsistency, not a user typo.

Solutions

  1. Verify the model node was fully populated with Snowflake attributes during parsing
  2. Check that the adapter type and node type agree (Snowflake refresh_warehouse on a Snowflake model)
  3. Report as an internal bug if snowflake_attr is legitimately absent
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/dbt-adapter/src/relation/snowflake/config/components/refresh_warehouse.rs:61 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of dbt-labs/dbt-core@0267ce9170 (2026-09-07). Data as JSON: /api/errors/f7e24b5add948b7a. Report an issue: GitHub.

Appendix: source

Thrown at crates/dbt-adapter/src/relation/snowflake/config/components/refresh_warehouse.rs:61

    Ok(new_component(None))
}

fn from_local_config(
    relation_config: &dyn InternalDbtNodeAttributes,
) -> AdapterResult<RefreshWarehouse> {
    let snowflake_config = relation_config
        .as_any()
        .downcast_ref::<DbtModel>()
        .ok_or_else(|| {
            AdapterError::new(
                dbt_common::AdapterErrorKind::UnexpectedResult,
                "relation config needs to be a model",
            )
        })?
        .__adapter_attr__
        .snowflake_attr
        .as_ref()
        .expect("relation config needs to be Snowflake model");
    Ok(new_component(snowflake_config.refresh_warehouse.clone()))
}

impl_loader!(RefreshWarehouse, SnowflakeDescribeResults);

#[cfg(test)]
mod tests {
    use super::*;
    use crate::relation::snowflake::config::test_helpers;

    #[test]
    fn from_remote_state_is_always_none() {
        // Whatever the remote state, refresh_warehouse is not reported by DESCRIBE.
        let remote_state = test_helpers::make_remote_config(test_helpers::TestDynamicTableConfig {
            snowflake_warehouse: Some("ANY_WH"),
            ..Default::default()
        });
        let loaded = from_remote_state(&remote_state).unwrap();

View on GitHub (pinned to 0267ce9170)