{"record":{"id":"0f69fc8c67c9cf42","repo":"dbt-labs/dbt-core","slug":"unset-constraints-should-be-iterable","errorCode":null,"errorMessage":"unset_constraints should be iterable","messagePattern":"unset_constraints should be iterable","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-adapter/src/relation/databricks/config/components/constraints.rs","lineNumber":953,"sourceCode":"        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\");\n        assert!(\n            !render_val.is_undefined(),\n            \"render should be a callable function\"","sourceCodeStart":935,"sourceCodeEnd":971,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adapter/src/relation/databricks/config/components/constraints.rs#L935-L971","documentation":"Test-only assertion in test_constraints_to_jinja_exposes_object_attributes: the value of the `unset_constraints` attribute must be iterable so templates can loop over constraints. Fires only if the Jinja representation of the constraints set stops supporting iteration.","triggerScenarios":"Thrown at crates/dbt-adapter/src/relation/databricks/config/components/constraints.rs:953 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure unset_constraints is rendered as a Jinja sequence object implementing try_iter","Check the object type returned for unset_constraints in to_jinja","Treat failure as a regression in the Jinja constraints wrapper"],"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"}