dbt-labs/dbt-core · error

load_dataframe() for the Salesforce adapter

Error message

load_dataframe() for the Salesforce adapter

What it means

This is a Rust `todo!()` panic in `load_dataframe` of the base adapter implementation. The code explicitly handles BigQuery and falls back to a `todo!()` for the Salesforce adapter, meaning load_dataframe is declared for Salesforce in the adapter enum but its implementation was never written. Any call that routes load_dataframe to Salesforce aborts the process with the message 'load_dataframe() for the Salesforce adapter'. All other adapters (Postgres, Snowflake, etc.) hit a separate `unimplemented!()` arm.

Source

Thrown at crates/dbt-adapter/src/adapter/adapter_impl.rs:3506

                            INGEST_FILE_DELIMITER.to_string(),
                            OptionValue::String(field_delimiter.to_string()),
                        ),
                        (
                            INGEST_PATH.to_string(),
                            OptionValue::String(file_path.to_string()),
                        ),
                        (
                            INGEST_SCHEMA.to_string(),
                            OptionValue::Bytes(serialized_ingest_schema),
                        ),
                    ],
                    false,
                    token,
                )?;

                Ok(none_value())
            }
            Salesforce => todo!("load_dataframe() for the Salesforce adapter"),
            Postgres | Snowflake | Databricks | Redshift | Spark | DuckDB | LakeCompute
            | Fabric | ClickHouse | Exasol | Starburst | Athena | Trino | Datafusion | Dremio
            | Oracle => {
                unimplemented!("only available with BigQuery or Salesforce adapter")
            }
        }
    }

    /// This only supports non-nested columns additions
    ///
    /// Since internally this is only used by snapshot materialization macro where newly added
    /// columns all have non-nested data types, Read from
    /// [here](https://github.com/sdf-labs/fs/blob/9b87be839f6aa54cab1ab91cde2c77855758c396/crates/dbt-loader/src/dbt_macro_assets/dbt-adapters/macros/materializations/snapshots/snapshot.sql#L32-L33).
    /// This builds sql that creates the snapshot relation, and this relation only adds non-nested
    /// columns to the source relation it is supposed to work well for this use case due to
    /// limitation:
    /// https://cloud.google.com/bigquery/docs/managing-table-schemas#add_a_nested_column_to_a_record_column
    ///

View on GitHub (pinned to 0267ce9170)

Solutions

  1. Switch the target/adapter to BigQuery for operations that require load_dataframe; Salesforce has no implementation yet.
  2. Implement the Salesforce arm in crates/dbt-adapter/src/adapter/adapter_impl.rs around line 3506, reusing the BigQuery loading path adapted to Salesforce API limits.
  3. Check the adapter feature matrix/issue tracker for Salesforce load_dataframe support status before using it in a pipeline.
  4. Wrap the call site in catch_unwind or pre-check the adapter type and return a friendly error instead of panicking.

Example fix

// before
let adapter = AdapterType::Salesforce;
adapter.load_dataframe(df)?; // panics: todo!()
// after
if adapter != AdapterType::BigQuery {
    return Err(anyhow!("load_dataframe is only supported for BigQuery; got {:?}", adapter));
}
adapter.load_dataframe(df)?;
Defensive patterns

Strategy: type-guard

Validate before calling

if adapter.adapter_type() == AdapterType::Salesforce {
    return Err(anyhow!("load_dataframe is not implemented for the Salesforce adapter; use BigQuery"));
}

Type guard

fn supports_load_dataframe(t: AdapterType) -> bool { matches!(t, AdapterType::BigQuery) }

Try / catch

let result = std::panic::catch_unwind(AssertUnwindSafe(|| adapter.load_dataframe(df)));
match result {
    Ok(v) => v?,
    Err(_) => return Err(anyhow!("load_dataframe panicked: not implemented for this adapter")),
}

Prevention

When it happens

Trigger: Calling the public `load_dataframe` method (directly or via a data-loading flow such as seed/snapshot ingestion) while connected with a Salesforce adapter profile. The match reaches the `Salesforce => todo!(...)` arm in adapter_impl.rs:3506 and panics immediately.

Common situations: Running a dbt operation that needs to load a DataFrame (e.g. seeds or state:relation data loading) against a Salesforce adapter because the project yml or --adapter flag selected Salesforce instead of BigQuery. Also hit by developers testing adapter coverage who assumed Salesforce support exists for this method.

Related errors


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