dbt-labs/dbt-core · error

Trino

Error message

Trino

What it means

This is a Rust `todo!()` panic from `create_static_relation` in crates/dbt-adapter/src/relation/factory.rs:29. The `Trino` match arm is an unimplemented placeholder, so a call resolving to `AdapterType::Trino` panics with the message 'Trino'. It signals that static relation creation for Trino has not been ported yet.

Source

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

/// Create a static relation value from an adapter type
/// To be used as api.Relation in the Jinja environment
pub fn create_static_relation(
    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 `Trino` arm in `create_static_relation`, constructing the Trino-appropriate `RelationStatic`/`StaticBaseRelationObject`
  2. Intercept `AdapterType::Trino` at call sites and return an explicit unsupported-adapter error instead of reaching the panic
  3. Use an adapter whose factory arm is implemented while Trino support is pending

Example fix

// before
Trino => todo!("Trino"),
// after
Trino => {
    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::Trino) {
    return Err("create_static_relation is not implemented for Trino".into());
}

Type guard

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

Try / catch

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

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::Trino`.

Common situations: A Trino-profiled dbt run where jinja invokes the relation factory; a test sweep or adapter-dispatch loop iterating all AdapterType variants; someone wiring a new Trino integration before the factory arm exists.

Related errors


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