{"record":{"id":"b9f0b030e2c2d064","repo":"dbt-labs/dbt-core","slug":"type-should-be-accessible","errorCode":null,"errorMessage":"type should be accessible","messagePattern":"type should be accessible","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-adapter/src/relation/databricks/config/components/constraints.rs","lineNumber":958,"sourceCode":"        let constraints = Constraints::new(\n            IndexSet::new(),\n            IndexSet::new(),\n            IndexSet::new(),\n            IndexSet::from([pk]),\n        );\n\n        let jinja_val = constraints.to_jinja();\n        let unset = jinja_val\n            .get_attr(\"unset_constraints\")\n            .expect(\"unset_constraints should be accessible\");\n        let mut iter = unset\n            .try_iter()\n            .expect(\"unset_constraints should be iterable\");\n        let constraint_val = iter.next().expect(\"should have one constraint\");\n\n        let type_val = constraint_val\n            .get_attr(\"type\")\n            .expect(\"type should be accessible\");\n        assert_eq!(type_val.as_str(), Some(\"primary_key\"));\n\n        let name_val = constraint_val\n            .get_attr(\"name\")\n            .expect(\"name should be accessible\");\n        assert_eq!(name_val.as_str(), Some(\"pk_id\"));\n\n        let render_val = constraint_val\n            .get_attr(\"render\")\n            .expect(\"render should be accessible\");\n        assert!(\n            !render_val.is_undefined(),\n            \"render should be a callable function\"\n        );\n    }\n\n    #[test]\n    fn test_constraint_normalization_and_diff() {","sourceCodeStart":940,"sourceCodeEnd":976,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adapter/src/relation/databricks/config/components/constraints.rs#L940-L976","documentation":"Test-only assertion in test_constraints_to_jinja_exposes_object_attributes: the first constraint yielded by iterating unset_constraints must expose a `type` attribute readable from Jinja. Fires only if individual constraint objects stop exposing their type.","triggerScenarios":"Thrown at crates/dbt-adapter/src/relation/databricks/config/components/constraints.rs:958 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure each constraint in the Jinja wrapper exposes a `type` attribute","Check the per-constraint object implementation used by to_jinja","Treat failure as a regression in Jinja attribute exposure"],"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"}