{"record":{"id":"fe538b5d6497d7a3","repo":"dbt-labs/dbt-core","slug":"inline-exclude-should-remain-inside-union","errorCode":null,"errorMessage":"inline exclude should remain inside union","messagePattern":"inline exclude should remain inside union","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-parser/src/resolve/resolve_selectors.rs","lineNumber":836,"sourceCode":"            definition.get(\"intersection\").is_none(),\n            \"mixed selector references must not force whole-expression AST serialization\"\n        );\n        let union = definition\n            .get(\"union\")\n            .and_then(|value| value.as_sequence())\n            .expect(\"manifest should preserve original union\");\n        assert_eq!(union.len(), 3);\n        assert_eq!(\n            union[0].get(\"method\").and_then(|v| v.as_str()),\n            Some(\"selector\")\n        );\n        assert_eq!(union[0].get(\"value\").and_then(|v| v.as_str()), Some(\"base\"));\n        assert_eq!(union[1].get(\"method\").and_then(|v| v.as_str()), Some(\"fqn\"));\n        assert_eq!(union[1].get(\"value\").and_then(|v| v.as_str()), Some(\"d\"));\n        let exclude = union[2]\n            .get(\"exclude\")\n            .and_then(|value| value.as_sequence())\n            .expect(\"inline exclude should remain inside union\");\n        assert_eq!(exclude[0].get(\"value\").and_then(|v| v.as_str()), Some(\"e\"));\n        Ok(())\n    }\n\n    #[test]\n    fn test_manifest_selector_preserves_pure_selector_alias() -> FsResult<()> {\n        let mut selector_ref = BTreeMap::new();\n        selector_ref.insert(\"selector\".to_string(), SelectorValue::from(\"base\").into());\n        let original_definition =\n            SelectorDefinitionValue::Full(SelectorExpr::Atom(AtomExpr::MethodKey(selector_ref)));\n        let normalized_include = SelectExpression::And(vec![\n            SelectExpression::Or(vec![atom(MethodName::Fqn, \"a\"), atom(MethodName::Fqn, \"b\")]),\n            SelectExpression::Exclude(Box::new(atom(MethodName::Fqn, \"c\"))),\n        ]);\n        let resolved_selectors = HashMap::from([(\n            \"alias\".to_string(),\n            SelectorEntry {\n                include: normalized_include,","sourceCodeStart":818,"sourceCodeEnd":854,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-parser/src/resolve/resolve_selectors.rs#L818-L854","documentation":"Test-only assertion in test_manifest_selector_preserves_mixed_union_with_selector_reference: a union mixing plain values and selector references must still serialize as a plain union with inline exclude, not force whole-expression AST serialization. Fires if mixed unions regress to AST output.","triggerScenarios":"Thrown at crates/dbt-parser/src/resolve/resolve_selectors.rs:836 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the definition-preservation heuristic for unions containing selector references","Keep the mixed-union fixture in the suite","Treat failure as a manifest 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"}