{"record":{"id":"a1c064f0356d6a49","repo":"dbt-labs/dbt-core","slug":"datafusion-a1c064","errorCode":null,"errorMessage":"Datafusion","messagePattern":"Datafusion","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/dbt-adapter/src/adapter/adapter_impl.rs","lineNumber":321,"sourceCode":"                            as Box<dyn MetadataAdapter>,\n                        DuckDB => {\n                            Box::new(DuckDBMetadataAdapter::new(engine)) as Box<dyn MetadataAdapter>\n                        }\n                        LakeCompute => {\n                            Box::new(DuckDBMetadataAdapter::new(engine)) as Box<dyn MetadataAdapter>\n                        }\n                        Fabric => {\n                            Box::new(FabricMetadataAdapter::new(engine)) as Box<dyn MetadataAdapter>\n                        }\n                        ClickHouse => Box::new(ClickHouseMetadataAdapter::new(engine))\n                            as Box<dyn MetadataAdapter>,\n                        Exasol => {\n                            Box::new(ExasolMetadataAdapter::new(engine)) as Box<dyn MetadataAdapter>\n                        }\n                        Starburst => todo!(\"Starburst\"),\n                        Athena => todo!(\"Athena\"),\n                        Trino => todo!(\"Trino\"),\n                        Datafusion => todo!(\"Datafusion\"),\n                        Dremio => todo!(\"Dremio\"),\n                        Oracle => todo!(\"Oracle\"),\n                    };\n                Some(metadata_adapter)\n            }\n        }\n    }\n\n    /// Execute `use warehouse [name]` statement for Snowflake.\n    /// For other warehouses, this is noop.\n    /// Returns whether the connection changed and must be restored.\n    pub fn use_warehouse(\n        &self,\n        conn: &'_ mut dyn Connection,\n        warehouse: String,\n        node_id: &str,\n        token: CancellationToken,\n    ) -> FsResult<bool> {","sourceCodeStart":303,"sourceCodeEnd":339,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adapter/src/adapter/adapter_impl.rs#L303-L339","documentation":"A `todo!()` panic raised when `metadata_adapter` tries to construct a metadata adapter for the Datafusion adapter type. No Datafusion metadata adapter implementation exists yet in the dispatch table at crates/dbt-adapter/src/adapter/adapter_impl.rs:318-323, so the arm unconditionally panics with the message \"Datafusion\". This is a placeholder marking unfinished work that aborts instead of returning an error.","triggerScenarios":"Calling `metadata_adapter()` on a DbtAdapter whose adapter_type() is AdapterType::Datafusion in non-sidecar, non-explicit-mock mode.","commonSituations":"Running dbt against a Datafusion profile before Datafusion support is added; enumerating adapter types in tests or tooling; a config that selects datafusion as the adapter while the feature is still unimplemented.","solutions":["Switch to an implemented adapter type (Snowflake, Bigquery, Databricks, Redshift, Postgres, DuckDB, Fabric, ClickHouse, Exasol, etc.) until Datafusion is supported.","Implement the Datafusion arm: replace `Datafusion => todo!(\"Datafusion\")` with construction of a Datafusion metadata adapter, e.g. `Box::new(DatafusionMetadataAdapter::new(engine)) as Box<dyn MetadataAdapter>`.","Use sidecar mode so schema hydration is handled via db_runner and `metadata_adapter` returns None before reaching the match."],"exampleFix":"// before\nDatafusion => todo!(\"Datafusion\"),\n// after\nDatafusion => Box::new(DatafusionMetadataAdapter::new(engine)) as Box<dyn MetadataAdapter>,","handlingStrategy":"validation","validationCode":"const SUPPORTED: &[AdapterType] = &[\n    AdapterType::Snowflake, AdapterType::Bigquery, AdapterType::Databricks,\n    AdapterType::Spark, AdapterType::Redshift, AdapterType::Salesforce,\n    AdapterType::Postgres, AdapterType::DuckDB, AdapterType::LakeCompute,\n    AdapterType::Fabric, AdapterType::ClickHouse, AdapterType::Exasol,\n];\nassert!(SUPPORTED.contains(&adapter.adapter_type()), \"Datafusion metadata adapter not implemented\");","typeGuard":"fn datafusion_supported(t: &AdapterType) -> bool {\n    !matches!(t, AdapterType::Datafusion | AdapterType::Starburst | AdapterType::Athena | AdapterType::Trino | AdapterType::Dremio | AdapterType::Oracle)\n}","tryCatchPattern":"let result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| adapter.metadata_adapter()));\nif result.is_err() {\n    eprintln!(\"metadata adapter dispatch is unimplemented for this adapter type; use a supported engine or sidecar mode\");\n}","preventionTips":["Validate adapter type against the supported list at config load time.","Prefer sidecar mode for engines whose metadata adapter is not yet implemented.","Watch the changelog for Datafusion implementation before opting in.","Keep integration tests per engine so unimplemented paths fail in CI, not production."],"tags":["unimplemented","todo-panic","adapter","metadata","datafusion"],"backgroundTag":"method-not-implemented","analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}