{"record":{"id":"cec7bdc492b16944","repo":"dbt-labs/dbt-core","slug":"expected-union-sequence-inside-exclude","errorCode":null,"errorMessage":"expected `union` sequence inside exclude","messagePattern":"expected `union` sequence inside exclude","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-parser/src/resolve/resolve_selectors.rs","lineNumber":606,"sourceCode":"            ]))),\n        ));\n\n        let yaml = select_expression_to_yaml(&expr);\n\n        assert_eq!(yaml.get(\"method\").and_then(|v| v.as_str()), Some(\"fqn\"));\n        assert_eq!(yaml.get(\"value\").and_then(|v| v.as_str()), Some(\"*\"));\n\n        // `exclude` must be a single-element list wrapping the union.\n        let exclude = yaml\n            .get(\"exclude\")\n            .and_then(|v| v.as_sequence())\n            .expect(\"expected `exclude` sequence in serialized atom\");\n        assert_eq!(exclude.len(), 1);\n\n        let union = exclude[0]\n            .get(\"union\")\n            .and_then(|v| v.as_sequence())\n            .expect(\"expected `union` sequence inside exclude\");\n        let mut tags: Vec<String> = union\n            .iter()\n            .map(|item| {\n                assert_eq!(item.get(\"method\").and_then(|v| v.as_str()), Some(\"tag\"));\n                item.get(\"value\")\n                    .and_then(|v| v.as_str())\n                    .unwrap()\n                    .to_string()\n            })\n            .collect();\n        tags.sort();\n        assert_eq!(tags, vec![\"feed_service_now\", \"usage\"]);\n    }\n\n    /// An atom without a nested exclude must not emit an `exclude` key (no\n    /// spurious empty `exclude: []`).\n    #[test]\n    fn test_serialize_atom_without_exclude() {","sourceCodeStart":588,"sourceCodeEnd":624,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-parser/src/resolve/resolve_selectors.rs#L588-L624","documentation":"Test-only assertion in test_serialize_atom_with_nested_exclude: the serialized selector atom's `exclude` entry must contain a `union` sequence as its single element. Fires only if selector YAML serialization flattens or drops the nested union inside exclude.","triggerScenarios":"Thrown at crates/dbt-parser/src/resolve/resolve_selectors.rs:606 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix selector_atom_to_yaml to nest the union inside the exclude list","Re-run the selector serialization tests","Treat failure as a selector YAML shape 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"}