{"record":{"id":"c5f5e38e20d125f5","repo":"dbt-labs/dbt-core","slug":"unset-constraints-should-be-accessible","errorCode":null,"errorMessage":"unset_constraints should be accessible","messagePattern":"unset_constraints should be accessible","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-adapter/src/relation/databricks/config/components/constraints.rs","lineNumber":950,"sourceCode":"    #[test]\n    fn test_constraints_to_jinja_exposes_object_attributes() {\n        // Bug 1: constraint.type and constraint.name must be accessible in Jinja templates.\n        let pk = TypedConstraint::PrimaryKey {\n            name: Some(\"pk_id\".to_string()),\n            columns: vec![\"id\".to_string()],\n            expression: None,\n        };\n        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\");","sourceCodeStart":932,"sourceCodeEnd":968,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adapter/src/relation/databricks/config/components/constraints.rs#L932-L968","documentation":"Test-only assertion in test_constraints_to_jinja_exposes_object_attributes: the Jinja value produced by Constraints::to_jinja() must expose an `unset_constraints` attribute (regression guard for attribute accessibility from Jinja templates). Fires only if to_jinja stops exposing that attribute.","triggerScenarios":"Thrown at crates/dbt-adapter/src/relation/databricks/config/components/constraints.rs:950 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix Constraints::to_jinja so unset_constraints is exposed as an attribute","Check the Jinja object implementation for the constraints wrapper","Treat failure as a regression in Jinja attribute exposure, not a runtime error"],"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"}