dbt-labs/dbt-core · error

Unknown method on StaticBaseRelationObject

Error message

Unknown method on StaticBaseRelationObject: '{name}'

What it means

The `StaticBaseRelationObject`'s `call_method` dispatcher received a method name outside its supported set (`create`, `scd_args`, `get_default_quote_policy`, etc.). Any unknown name falls through to this UnknownMethod error, signaling the method does not exist on this static relation object.

Solutions

  1. Check the method name against the match arms in `StaticBaseRelationObject::call_method`.
  2. Use the concrete adapter relation object if the method is adapter-specific.
  3. Implement or request the missing method in the dispatcher if porting a Python dbt macro that needs it.

Example fix

// before
{{ relation.render_constraints_for_create() }}
// after
{% if adapter.type() == 'databricks' %}
  {{ adapter_relation.render_constraints_for_create() }}
{% endif %}
Defensive patterns

Strategy: type-guard

Validate before calling

{% set supported = ['create', 'scd_args', 'get_default_quote_policy'] %}
{% if method_name not in supported %}{% do log('unsupported on static relation: ' ~ method_name) %}{% endif %}

Prevention

When it happens

Trigger: Calling an instance-level or adapter-specific relation method (e.g. `relation.information_schema`, `render_constraints_for_create`, `materialized_view_from_relation_config`) on the static base relation object instead of the concrete adapter relation.

Common situations: Using generic relation objects where adapter-specific ones are required; ported Python macros calling methods not implemented on the static object; typos in method names.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at crates/dbt-adapter/src/relation/relation_object.rs:799

                    crate::relation::bigquery::config::relation_types::materialized_view::new_loader();
                let relation_config = loader
                    .from_local_config(local_config.as_internal_node())
                    .map_err(|err| {
                        minijinja::Error::new(
                            minijinja::ErrorKind::InvalidOperation,
                            format!("error while loading local materialized view config: {err}"),
                        )
                    })?;
                Ok(Value::from_object(relation_config))
            }
            "get_default_quote_policy" => {
                let iter = ArgsIter::new("Relation.get_default_quote_policy", &[], args);
                iter.finish()?;
                Ok(Value::from_object(QuotePolicyObject(
                    self.0.get_default_quoting(),
                )))
            }
            _ => Err(minijinja::Error::new(
                minijinja::ErrorKind::UnknownMethod,
                format!("Unknown method on StaticBaseRelationObject: '{name}'"),
            )),
        }
    }
}

/// Trait for static methods on relations
pub trait StaticBaseRelation: fmt::Debug + Send + Sync {
    /// Create a new relation from the given arguments
    fn try_new(
        &self,
        database: Option<String>,
        schema: Option<String>,
        identifier: Option<String>,
        relation_type: Option<RelationType>,
        custom_quoting: Option<ResolvedQuoting>,
        temporary: Option<bool>,

View on GitHub (pinned to 0267ce9170)