{"record":{"id":"f7e24b5add948b7a","repo":"dbt-labs/dbt-core","slug":"relation-config-needs-to-be-snowflake-model","errorCode":null,"errorMessage":"relation config needs to be Snowflake model","messagePattern":"relation config needs to be Snowflake model","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-adapter/src/relation/snowflake/config/components/refresh_warehouse.rs","lineNumber":61,"sourceCode":"    Ok(new_component(None))\n}\n\nfn from_local_config(\n    relation_config: &dyn InternalDbtNodeAttributes,\n) -> AdapterResult<RefreshWarehouse> {\n    let snowflake_config = relation_config\n        .as_any()\n        .downcast_ref::<DbtModel>()\n        .ok_or_else(|| {\n            AdapterError::new(\n                dbt_common::AdapterErrorKind::UnexpectedResult,\n                \"relation config needs to be a model\",\n            )\n        })?\n        .__adapter_attr__\n        .snowflake_attr\n        .as_ref()\n        .expect(\"relation config needs to be Snowflake model\");\n    Ok(new_component(snowflake_config.refresh_warehouse.clone()))\n}\n\nimpl_loader!(RefreshWarehouse, SnowflakeDescribeResults);\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use crate::relation::snowflake::config::test_helpers;\n\n    #[test]\n    fn from_remote_state_is_always_none() {\n        // Whatever the remote state, refresh_warehouse is not reported by DESCRIBE.\n        let remote_state = test_helpers::make_remote_config(test_helpers::TestDynamicTableConfig {\n            snowflake_warehouse: Some(\"ANY_WH\"),\n            ..Default::default()\n        });\n        let loaded = from_remote_state(&remote_state).unwrap();","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adapter/src/relation/snowflake/config/components/refresh_warehouse.rs#L43-L79","documentation":"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.","triggerScenarios":"Thrown at crates/dbt-adapter/src/relation/snowflake/config/components/refresh_warehouse.rs:61 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the model node was fully populated with Snowflake attributes during parsing","Check that the adapter type and node type agree (Snowflake refresh_warehouse on a Snowflake model)","Report as an internal bug if snowflake_attr is legitimately absent"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}