{"record":{"id":"785240f364e204df","repo":"dbt-labs/dbt-core","slug":"modelpropertiessemanticmodelconfig-is-never-finali","errorCode":null,"errorMessage":"ModelPropertiesSemanticModelConfig is never finalized directly","messagePattern":"ModelPropertiesSemanticModelConfig is never finalized directly","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-schemas/src/schemas/properties/model_properties.rs","lineNumber":102,"sourceCode":"}\n\nimpl ResolvableConfig<SemanticModelConfig> for ModelPropertiesSemanticModelConfig {\n    type Resolved = ResolvedSemanticModelConfig;\n    type PackageDefaults = ();\n    type ResolveDefaults = ();\n\n    fn get_enabled_with_default(&self) -> bool {\n        self.enabled\n    }\n\n    fn disable(&mut self) {\n        self.enabled = false;\n    }\n\n    fn apply_package_defaults(&mut self, _: ()) {}\n\n    fn finalize(self) -> ResolvedSemanticModelConfig {\n        unreachable!(\"ModelPropertiesSemanticModelConfig is never finalized directly\")\n    }\n\n    fn default_to(&mut self, parent: &SemanticModelConfig) {\n        DefaultTo::inherit_from(&mut self.group, &parent.group);\n    }\n}\n\nimpl ModelProperties {\n    pub fn empty(name: String) -> Self {\n        Self {\n            name,\n            columns: None,\n            config: None,\n            constraints: None,\n            data_tests: None,\n            deprecation_date: None,\n            description: None,\n            identifier: None,","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-schemas/src/schemas/properties/model_properties.rs#L84-L120","documentation":"ModelPropertiesSemanticModelConfig is an intermediate 'draft' config that implements a finalize trait, but by design it is never finalized as-is; it must first be converted/merged into another config form. Calling finalize() on it directly indicates a pipeline bug where the wrong config type reached the resolution step. The panic is a guard that surfaces such misuse immediately instead of producing a half-resolved semantic model.","triggerScenarios":"Invoking DefaultTo/finalize resolution machinery with a ModelPropertiesSemanticModelConfig value instead of the wrapper type that is actually meant to be finalized.","commonSituations":"Refactoring the properties-resolution pipeline so a semantic model config bypasses its wrapper; writing new code that calls finalize() generically on any config implementing the trait; custom tooling that reuses dbt-schemas config types and calls finalize directly.","solutions":["Do not call finalize() on ModelPropertiesSemanticModelConfig directly; finalize the containing/wrapper config instead.","Locate the resolution call site and ensure the semantic model config is converted to the final ResolvedSemanticModelConfig via the intended wrapper path.","If adding a new config type, implement finalize() with a real conversion rather than routing through this placeholder.","Check for recent refactors in properties model resolution that may have swapped config types."],"exampleFix":"// before\nlet resolved = semantic_cfg.finalize()?; // panics: draft type never finalized directly\n\n// after\nlet resolved = properties.semantic_model.unwrap().finalize()?; // finalize the wrapper that owns the conversion","handlingStrategy":"type-guard","validationCode":"if cfg.is_draft_intermediate() { /* route through wrapper, not finalize */ }","typeGuard":"fn is_finalizable_directly<T: Finalize>(_cfg: &T) -> bool { false } // draft types are never finalized directly; finalize their wrapper instead","tryCatchPattern":null,"preventionTips":["Never call finalize() on intermediate/draft config types; finalize the wrapper that owns the conversion.","Mark draft config types with #[doc(hidden)] or a naming convention signaling intermediacy.","Prefer newtype wrappers so the wrong finalize target cannot typecheck."],"tags":["rust","config-resolution","unreachable","semantic-model"],"backgroundTag":"internal-invariant-violation","analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}