{"record":{"id":"25f3bdb936484327","repo":"dbt-labs/dbt-core","slug":"downcast-failed","errorCode":null,"errorMessage":"Downcast failed","messagePattern":"Downcast failed","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-adapter/src/relation/config_v2.rs","lineNumber":771,"sourceCode":"        fn eq(&self, other: &Self) -> bool {\n            self.value == other.value\n        }\n    }\n\n    impl<T: Eq + fmt::Debug + Send + Sync + Any + Clone> Eq for SimpleComponentConfigImpl<T> {}\n\n    fn custom_diff(desired_state: &u8, current_state: &u8) -> Option<u8> {\n        let diff = desired_state - current_state;\n        if diff != 0 { Some(diff) } else { None }\n    }\n\n    fn assert_dyn_eq<T: Clone + Eq + fmt::Debug + 'static>(a: T, b: Box<dyn ComponentConfig>) {\n        assert_eq!(\n            a,\n            b.as_ref()\n                .as_any()\n                .downcast_ref::<T>()\n                .expect(\"Downcast failed\")\n                .clone()\n        )\n    }\n\n    fn assert_component_config_change_eq<T: fmt::Debug + PartialEq + 'static>(\n        a: &ComponentConfigChange,\n        b: &ComponentConfigChange,\n    ) {\n        assert_eq!(std::mem::discriminant(a), std::mem::discriminant(b));\n        if let (ComponentConfigChange::Some(a_diff), ComponentConfigChange::Some(b_diff)) = (a, b) {\n            assert_eq!(\n                a_diff.as_any().downcast_ref::<T>(),\n                b_diff.as_any().downcast_ref::<T>()\n            );\n        }\n    }\n\n    fn return_true(_: &IndexMap<&'static str, ComponentConfigChange>) -> bool {","sourceCodeStart":753,"sourceCodeEnd":789,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adapter/src/relation/config_v2.rs#L753-L789","documentation":"Test helper assertion in assert_dyn_eq: after downcasting the boxed dyn ComponentConfig back to its concrete type T via as_any().downcast_ref(), the downcast returned None. This guard verifies the Any plumbing of component configs; it fails only if T does not match the boxed component's concrete type.","triggerScenarios":"Thrown at crates/dbt-adapter/src/relation/config_v2.rs:771 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure assert_dyn_eq is called with the same concrete type that was boxed","Check that SimpleComponentConfigImpl implements as_any returning the correct Self type","Treat failure as a test-helper misuse, not a runtime error"],"exampleFix":null,"handlingStrategy":"type-guard","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"}