dbt-labs/dbt-core · error

Datafusion

Error message

Datafusion

What it means

This is a Rust `todo!()` panic from `create_static_relation` in crates/dbt-adapter/src/relation/factory.rs:32. The `Datafusion` match arm is an unimplemented placeholder, so calls resolving to `AdapterType::Datafusion` panic with the message 'Datafusion'. It indicates Datafusion static relation creation is not yet written in the Rust adapter.

Source

Thrown at crates/dbt-adapter/src/relation/factory.rs:32

    adapter_type: AdapterType,
    quoting: ResolvedQuoting,
) -> Option<Value> {
    use AdapterType::*;
    let result = match adapter_type {
        Snowflake | Databricks | Spark | Fabric | DuckDB | LakeCompute | Exasol | Postgres
        | Redshift | Salesforce | Bigquery | ClickHouse => {
            let relation_type = RelationStatic {
                adapter_type,
                quoting,
            };
            StaticBaseRelationObject::new(Arc::new(relation_type))
        }
        Starburst => todo!("Starburst"),
        Athena => todo!("Athena"),
        Trino => todo!("Trino"),
        Dremio => todo!("Dremio"),
        Oracle => todo!("Oracle"),
        Datafusion => todo!("Datafusion"),
    };
    Some(Value::from_object(result))
}

View on GitHub (pinned to 0267ce9170)

Solutions

  1. Implement the `Datafusion` arm in `create_static_relation`, constructing the Datafusion-specific `RelationStatic`/`StaticBaseRelationObject`
  2. Guard call sites to return an explicit unsupported-adapter error for `AdapterType::Datafusion`
  3. Exercise the factory only with adapters whose arms are implemented

Example fix

// before
Datafusion => todo!("Datafusion"),
// after
Datafusion => {
    let relation_type = RelationStatic { adapter_type, quoting };
    StaticBaseRelationObject::new(Arc::new(relation_type))
}
Defensive patterns

Strategy: validation

Validate before calling

if matches!(adapter_type, AdapterType::Datafusion) {
    return Err("create_static_relation is not implemented for Datafusion".into());
}

Type guard

fn static_relation_supported(t: AdapterType) -> bool {
    !matches!(t, AdapterType::Datafusion | AdapterType::Starburst | AdapterType::Athena | AdapterType::Trino | AdapterType::Dremio | AdapterType::Oracle)
}

Try / catch

match std::panic::catch_unwind(|| create_static_relation(adapter_type)) {
    Ok(v) => v,
    Err(_) => return Err("create_static_relation unimplemented for Datafusion"),
}

Prevention

When it happens

Trigger: Calling `create_static_relation` (directly, via `get_value`/`adapter_api_value`, or via the static-relation quote-policy tests) with `adapter_type == AdapterType::Datafusion`.

Common situations: A Datafusion-profiled dbt session invoking the relation factory from jinja; a developer sweeping all AdapterType variants in tests; onboarding a Datafusion adapter before the factory arm exists.

Related errors


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