{"record":{"id":"a64fda2ca81ace40","repo":"dbt-labs/dbt-core","slug":"should-have-one-constraint","errorCode":null,"errorMessage":"should have one constraint","messagePattern":"should have one constraint","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-adapter/src/relation/databricks/config/components/constraints.rs","lineNumber":954,"sourceCode":"            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\");\n        assert!(\n            !render_val.is_undefined(),\n            \"render should be a callable function\"\n        );","sourceCodeStart":936,"sourceCodeEnd":972,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adapter/src/relation/databricks/config/components/constraints.rs#L936-L972","documentation":"Test-only assertion in test_constraints_to_jinja_exposes_object_attributes: iterating the exposed unset_constraints value must yield at least one constraint (the primary key fixture). Fires only if constraints are dropped or hidden in the Jinja conversion.","triggerScenarios":"Thrown at crates/dbt-adapter/src/relation/databricks/config/components/constraints.rs:954 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that Constraints::to_jinja preserves all constraint entries","Verify the fixture PrimaryKey is included in the unset set","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"}