{"record":{"id":"c3d9c192a0e8ceb0","repo":"dbt-labs/dbt-core","slug":"dbtunittest-does-not-support-setting-detected-unsa","errorCode":null,"errorMessage":"DbtUnitTest does not support setting detected_unsafe","messagePattern":"DbtUnitTest does not support setting detected_unsafe","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-schemas/src/schemas/nodes.rs","lineNumber":2220,"sourceCode":"                    \"unit_test\",\n                    [(\n                        \"same_fqn\",\n                        same_fqn_result,\n                        Some((\n                            format!(\"{:?}\", &self.common().fqn),\n                            format!(\"{:?}\", &other_unit_test.common().fqn),\n                        )),\n                    )],\n                );\n            }\n\n            result\n        } else {\n            false\n        }\n    }\n    fn set_detected_introspection(&mut self, _introspection: IntrospectionKind) {\n        panic!(\"DbtUnitTest does not support setting detected_unsafe\");\n    }\n}\n\nfn same_unit_test_definition(_self_ut: &DbtUnitTest, _other_ut: &DbtUnitTest) -> bool {\n    // This dummy implementation makes explicit Fusion's current unit-test content under-selection:\n    true\n    // TODO: Implement parity with dbt-core's flagging a unit test on a checksum over\n    // model/versions/given/expect/overrides (+ fixture rows) — build_unit_test_checksum,\n    // dbt-mantle core/dbt/contracts/graph/nodes.py:1226.\n    // HAZARD when fixing: do NOT naively compare `checksum`. dbt-core manifests carry a real\n    // unit-test checksum while Fusion emits DbtChecksum::default(); comparing them directly would\n    // over-select every unit test against a dbt-core state manifest. The fix must populate Fusion's\n    // unit-test checksum consistently first, then compare.\n}\n\nimpl InternalDbtNodeAttributes for DbtUnitTest {\n    fn search_name(&self) -> String {\n        // Based on Python implementation, unit tests can have a versioned name","sourceCodeStart":2202,"sourceCodeEnd":2238,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-schemas/src/schemas/nodes.rs#L2202-L2238","documentation":"DbtUnitTest's set_detected_introspection is an intentional hard panic: unit tests are declarative test definitions with nothing to introspect on the warehouse, so detected-unsafe/introspection state cannot be set. The panic fires only when generic node code wrongly reaches this node kind.","triggerScenarios":"Thrown at crates/dbt-schemas/src/schemas/nodes.rs:2220 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the node kind before calling the introspection setter and skip DbtUnitTest","Gate the code path to node types that support warehouse introspection","Make the method a no-op instead of a panic if silent skipping is acceptable"],"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"}