dbt-labs/dbt-core · error

Athena

Error message

Athena

What it means

This is a Rust `todo!()` panic from `create_static_relation` in crates/dbt-adapter/src/relation/factory.rs:28. The `Athena` arm of the adapter-type match was left unimplemented, so any call that resolves to `AdapterType::Athena` panics with the message 'Athena'. The library throws it as an explicit marker that Athena static relation creation has not been written yet.

Source

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

/// 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 `Athena` match arm in `create_static_relation`, building the Athena-specific `RelationStatic` and `StaticBaseRelationObject`
  2. Guard call sites to return an error or fallback instead of calling the factory for `AdapterType::Athena` until support lands
  3. Exercise the factory only with implemented adapters (Snowflake, BigQuery, Redshift, Databricks-class arms that already construct a relation)

Example fix

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

Type guard

fn static_relation_supported(t: AdapterType) -> bool {
    !matches!(t, AdapterType::Athena | AdapterType::Starburst | AdapterType::Trino | 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 Athena"),
}

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

Common situations: Running dbt against an Athena profile where jinja code invokes `api.Relation.create` / the static relation factory; a developer running a test matrix over all adapter types; automation enumerating AdapterType variants hits the placeholder arm.

Related errors


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