{"record":{"id":"f2093ddc41fa1abe","repo":"dbt-labs/dbt-core","slug":"name-should-be-accessible","errorCode":null,"errorMessage":"name should be accessible","messagePattern":"name should be accessible","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-adapter/src/relation/databricks/config/components/constraints.rs","lineNumber":963,"sourceCode":"        );\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() {\n        let prev_constraint = TypedConstraint::Check {\n            name: Some(\"test_check\".to_string()),\n            expression: \"value > 0\".to_string(),\n            columns: Some(vec![\"value\".to_string()]), // With columns (from dbt definition)\n        };","sourceCodeStart":945,"sourceCodeEnd":981,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adapter/src/relation/databricks/config/components/constraints.rs#L945-L981","documentation":"Test-only assertion in test_constraints_to_jinja_exposes_object_attributes: the first constraint object must expose a `name` attribute (the fixture sets pk_id). Fires only if constraint names become inaccessible from Jinja templates.","triggerScenarios":"Thrown at crates/dbt-adapter/src/relation/databricks/config/components/constraints.rs:963 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure each constraint in the Jinja wrapper exposes a `name` attribute","Check that optional names (Some) are forwarded to the Jinja object","Treat failure as a regression in constraint serialization"],"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"}