dbt-labs/dbt-core · error

issue #10393 selector YAML should parse

Error message

issue #10393 selector YAML should parse

What it means

Test-only assertion: the selectors YAML from dbt-labs issue #10393 (union with inline exclude) must parse via dbt_yaml::from_str. Fires only if the SelectorFile deserializer regresses and rejects this valid shape.

Solutions

  1. Fix SelectorFile deserialization to accept inline exclude within union
  2. Keep the #10393 fixture YAML in the regression suite
  3. Treat failure as a selector parsing regression
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/dbt-parser/src/resolve/resolve_selectors.rs:689 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/b19cfae22a96ae35. Report an issue: GitHub.

Appendix: source

Thrown at crates/dbt-parser/src/resolve/resolve_selectors.rs:689

        assert!(selector_atom_to_yaml(&atom).is_err());
    }

    #[test]
    fn test_manifest_selector_preserves_union_with_inline_exclude_shape() -> FsResult<()> {
        let selector_file: SelectorFile = dbt_yaml::from_str(
            r#"
selectors:
  - name: all_except_c
    description: Union of a and b, excluding c
    definition:
      union:
        - a
        - b
        - exclude:
            - c
"#,
        )
        .expect("issue #10393 selector YAML should parse");
        let original_definition = selector_file.selectors[0].definition.clone();
        let normalized_include =
            SelectorParser::new(BTreeMap::new()).parse_definition(&original_definition)?;
        let resolved_selectors = HashMap::from([(
            "all_except_c".to_string(),
            SelectorEntry {
                include: normalized_include,
                is_default: false,
                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");

View on GitHub (pinned to 0267ce9170)