dbt-labs/dbt-core · error · InvalidOperation

Not implemented: {message}

Error message

Not implemented: {message}

What it means

`raise_not_implemented(msg)` (dbt's `exceptions.raise_not_implemented`) raises a compilation error prefixed with "Not implemented:" to signal that a code path — usually a materialization or adapter feature — is not supported in the current context. The library maps it to an InvalidOperation error carrying the user's message.

Source

Thrown at crates/dbt-jinja-utils/src/functions/base.rs:1155

                        format!(
                            "Compilation Error for {} from {}: {}",
                            node_id,
                            file_path.display(),
                            message
                        ),
                    ))
                } else {
                    Err(Error::new(
                        ErrorKind::InvalidOperation,
                        format!("Compilation Error: {message}"),
                    ))
                }
            }
            // (msg) String
            "raise_not_implemented" => {
                let mut args = ArgParser::new(args, None);
                let message = args.get::<String>("msg")?;
                Err(Error::new(
                    ErrorKind::InvalidOperation,
                    format!("Not implemented: {message}"),
                ))
            }
            // (relation, expected_type, model=None)
            //   Relation,  String
            "relation_wrong_type" => {
                let mut args = ArgParser::new(args, None);
                let relation = args.get::<Value>("relation").unwrap_or(Value::UNDEFINED);
                let expected_type = args.get::<String>("expected_type").unwrap_or_default();

                // Get the relation type from the relation value
                let relation_type = if relation.is_undefined() {
                    "unknown".to_string()
                } else {
                    match relation.get_item(&Value::from("type")) {
                        Ok(type_value) => type_value.to_string(),
                        Err(_) => "unknown".to_string(),

View on GitHub (pinned to 0267ce9170)

Solutions

  1. Use a supported materialization/strategy for your adapter (check adapter docs)
  2. Remove or gate the unsupported code path in custom macros
  3. Pin/upgrade adapter versions so the needed feature is implemented

Example fix

// before
{{ config(materialized='ephemeral', incremental_strategy='insert_overwrite') }}  // unsupported here
// after
{{ config(materialized='incremental', incremental_strategy='merge') }}
Defensive patterns

Strategy: try-catch

Validate before calling

{% if strategy not in supported_strategies %}{{ log('strategy ' ~ strategy ~ ' not supported by adapter') }}{% endif %}

Try / catch

match result {
    Err(e) if e.to_string().starts_with("Not implemented: ") => {
        switch_to_supported_strategy();
    }
    other => other?,
}

Prevention

When it happens

Trigger: A materialization or macro calls `{{ exceptions.raise_not_implemented("...") }}`, e.g. an adapter materialization hit an unsupported strategy, or `model.config.materialized` is a type the adapter doesn't implement.

Common situations: Using a materialization (e.g. incremental_strategy) not supported by the adapter, copy-pasting a macro from another adapter, or a dbt version change moving/renaming supported features.

Related errors


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