dbt-labs/dbt-core · error

DbtQuoting -> ResolvedQuoting conversion

Error message

DbtQuoting -> ResolvedQuoting conversion

What it means

A panic from an unchecked `TryInto` conversion when building the node base attributes for a snapshot: the snapshot's `DbtQuoting` config (as parsed from YAML) is converted into the resolved `ResolvedQuoting` representation expected downstream. The `expect` fires when the quoting config cannot be represented in resolved form — i.e. the quoting settings parsed from the project/snapshot config are invalid or out of the accepted domain.

Source

Thrown at crates/dbt-parser/src/resolve/resolve_snapshots.rs:558

                    database: "".to_owned(), // will be updated below
                    schema: "".to_owned(),   // will be updated below
                    alias: "".to_owned(),    // will be updated below
                    relation_name: None,     // will be updated below
                    columns,
                    depends_on: NodeDependsOn {
                        macros: macro_depends_on,
                        nodes: vec![],
                        nodes_with_ref_location: vec![],
                    },
                    compute: snapshot_config.compute,
                    enabled: snapshot_config.enabled,
                    extended_model: false,
                    persist_docs: snapshot_config.persist_docs.clone(),
                    materialized: snapshot_config.materialized.clone(),
                    quoting: snapshot_config
                        .quoting
                        .try_into()
                        .expect("DbtQuoting -> ResolvedQuoting conversion"),
                    quoting_ignore_case: snapshot_config
                        .quoting
                        .snowflake_ignore_case
                        .unwrap_or(false),
                    static_analysis_off_reason: (*static_analysis == StaticAnalysisKind::Off)
                        .then_some(StaticAnalysisOffReason::ConfiguredOff),
                    static_analysis,
                    refs: sql_file_info
                        .refs
                        .iter()
                        .map(|(model, project, version, location)| DbtRef {
                            name: model.to_owned(),
                            package: project.to_owned(),
                            version: version.clone(),
                            location: Some(location.with_file(&dbt_asset.path)),
                        })
                        .collect(),
                    unrendered_config,

View on GitHub (pinned to 0267ce9170)

Solutions

  1. Inspect the snapshot's `quoting:` config (and project-level snapshot defaults) and use only accepted keys/values (database/schema/identifier as booleans, snowflake_ignore_case as boolean)
  2. Delete stale `target/`/partial parse artifacts and re-parse so configs are re-read from source YAML
  3. Move the quoting config to `dbt_project.yml` `snapshots:` defaults to test whether the snapshot-level block is the problem
  4. If the value comes from generated config, fix the generator to emit the `DbtQuoting` schema this parser expects

Example fix

# before
snapshots:
  my_snapshot:
    +quoting:
      identifier: "true"   # string, not bool

# after
snapshots:
  my_snapshot:
    +quoting:
      identifier: true
Defensive patterns

Strategy: validation

Validate before calling

# pre-parse sanity check of a snapshot's quoting config
quoting = snapshot_cfg.get("quoting", {})
for key in ("database", "schema", "identifier"):
    if key in quoting and not isinstance(quoting[key], bool):
        raise ValueError(f"quoting.{key} must be a boolean, got {quoting[key]!r}")
if "snowflake_ignore_case" in quoting and not isinstance(quoting["snowflake_ignore_case"], bool):
    raise ValueError("quoting.snowflake_ignore_case must be a boolean")

Try / catch

// if invoking the resolver programmatically
let result = std::panic::catch_unwind(|| resolve_snapshots(...));
match result {
    Ok(res) => res?,
    Err(_) => anyhow::bail!("snapshot quoting config failed to convert; check 'quoting:' keys/values in dbt_project.yml and snapshot files"),
}

Prevention

When it happens

Trigger: Declaring a `quoting:` block under a snapshot (or snapshot defaults in `dbt_project.yml`) whose fields cannot convert to `ResolvedQuoting` — for example quoting values that are not the accepted boolean/enum forms, or a quoting config shape produced by programmatic/serialized input that the resolved type rejects.

Common situations: Typo'd or wrong-typed values in a `quoting:` config (e.g. strings instead of booleans, unexpected keys); a snapshot config assembled by tooling or copied from another dbt version with a different quoting schema; dependencies pinned to a dbt version whose quoting schema differs.

Related errors


AI-assisted analysis of dbt-labs/dbt-core@0267ce9170 (2026-09-07). Data as JSON: /api/errors/fa66722433f26895. Report an issue: GitHub.