dbt-labs/dbt-core · error
manifest should preserve original union
Error message
manifest should preserve original union
What it means
Test-only assertion in the #10393 regression test: the manifest-serialized definition must preserve the original union list rather than re-serializing the normalized runtime And as an intersection. Fires if normalization leaks into the manifest output.
Solutions
- Ensure resolve_manifest_selectors writes the original definition, not the normalized AST
- Keep the intersection-must-not-appear assertion in the suite
- Treat failure as a manifest shape regression
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/dbt-parser/src/resolve/resolve_selectors.rs:716 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of dbt-labs/dbt-core@0267ce9170 (2026-09-07).
Data as JSON: /api/errors/8553985cc5868c70.
Report an issue: GitHub.
Appendix: source
Thrown at crates/dbt-parser/src/resolve/resolve_selectors.rs:716
description: Some("Union of a and b, excluding c".to_string()),
definition: original_definition,
},
)]);
let manifest_selectors = resolve_manifest_selectors(resolved_selectors)?;
let definition = manifest_selectors
.get("all_except_c")
.and_then(|selector| selector.definition.as_ref())
.expect("selector definition should be present");
assert!(
definition.get("intersection").is_none(),
"manifest must not serialize normalized runtime And as intersection"
);
let union = definition
.get("union")
.and_then(|value| value.as_sequence())
.expect("manifest should preserve original union");
assert_eq!(union.len(), 3);
assert_eq!(union[0].get("method").and_then(|v| v.as_str()), Some("fqn"));
assert_eq!(union[0].get("value").and_then(|v| v.as_str()), Some("a"));
assert_eq!(union[1].get("method").and_then(|v| v.as_str()), Some("fqn"));
assert_eq!(union[1].get("value").and_then(|v| v.as_str()), Some("b"));
let exclude = union[2]
.get("exclude")
.and_then(|value| value.as_sequence())
.expect("inline exclude should remain a list inside union");
assert_eq!(exclude.len(), 1);
assert_eq!(
exclude[0].get("method").and_then(|v| v.as_str()),
Some("fqn")
);
assert_eq!(exclude[0].get("value").and_then(|v| v.as_str()), Some("c"));
Ok(())
}
View on GitHub (pinned to 0267ce9170)