{"record":{"id":"6c50c8d650d11761","repo":"dbt-labs/dbt-core","slug":"array-definition-should-become-a-union","errorCode":null,"errorMessage":"array definition should become a union","messagePattern":"array definition should become a union","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-parser/src/resolve/resolve_selectors.rs","lineNumber":657,"sourceCode":"\n        assert_eq!(\n            yaml.get(\"method\").and_then(|v| v.as_str()),\n            Some(\"config.materialized\")\n        );\n    }\n\n    #[test]\n    fn test_serialize_selector_definition_array_as_union() {\n        let definition = SelectorDefinitionValue::Array(vec![\n            SelectorDefinitionValue::String(\"a\".to_string()),\n            SelectorDefinitionValue::String(\"b\".to_string()),\n        ]);\n        let yaml = selector_definition_to_yaml(&definition).unwrap();\n\n        let sequence = yaml\n            .get(\"union\")\n            .and_then(|value| value.as_sequence())\n            .expect(\"array definition should become a union\");\n        assert_eq!(sequence.len(), 2);\n        assert_eq!(sequence[0].get(\"value\").and_then(|v| v.as_str()), Some(\"a\"));\n        assert_eq!(sequence[1].get(\"value\").and_then(|v| v.as_str()), Some(\"b\"));\n    }\n\n    #[test]\n    fn test_serialize_method_key_requires_one_entry() {\n        let method_value = BTreeMap::from([\n            (\"selector\".to_string(), SelectorValue::from(\"base\").into()),\n            (\"fqn\".to_string(), SelectorValue::from(\"other\").into()),\n        ]);\n        let atom = AtomExpr::MethodKey(method_value);\n\n        assert!(selector_atom_to_yaml(&atom).is_err());\n    }\n\n    #[test]\n    fn test_manifest_selector_preserves_union_with_inline_exclude_shape() -> FsResult<()> {","sourceCodeStart":639,"sourceCodeEnd":675,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-parser/src/resolve/resolve_selectors.rs#L639-L675","documentation":"Test-only assertion in test_serialize_selector_definition_array_as_union: an array-valued selector definition must serialize as a `union` sequence in the YAML output. Fires only if array definitions stop being converted to union form.","triggerScenarios":"Thrown at crates/dbt-parser/src/resolve/resolve_selectors.rs:657 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix selector_definition_to_yaml to map Array definitions to a union","Add coverage for multi-element arrays if missing","Treat failure as a selector serialization regression"],"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"}