dbt-labs/dbt-core · error
Unknown method on DefaultQuotePolicyObject
Error message
Unknown method on DefaultQuotePolicyObject: '{name}' What it means
The `DefaultQuotePolicyObject`'s `call_method` dispatcher received a method name it does not implement. Only the methods matched in its arms are supported; everything else falls to this UnknownMethod error. It surfaces when template code calls a method on the quote policy object that exists on other relation objects but not on this one.
Solutions
- Use only the methods implemented on DefaultQuotePolicyObject (see its `call_method` match arms).
- Read quoting fields as attributes (`database`, `schema`, `identifier`) rather than calling methods.
- If a needed method is missing, operate on the parent relation object instead of the policy object.
Example fix
// before
{% if policy.is_quoted() %}...{% endif %}
// after
{% set pol = relation.get_default_quote_policy() %}
{{ pol.database }}.{{ pol.schema }}.{{ pol.identifier }} Defensive patterns
Strategy: type-guard
Validate before calling
{% if policy.get_default_quote_policy is defined %}{% endif %} Prevention
- Remember the quote policy object exposes fields, not relation methods.
- Check the call_method match arms before calling new methods on it.
- Keep quoting logic limited to database/schema/identifier lookups.
When it happens
Trigger: Calling an unsupported method on a DefaultQuotePolicyObject obtained via `relation.get_default_quote_policy()`, e.g. `policy.render()` or any non-existent method name.
Common situations: Confusing the quote policy object with the relation object and calling relation methods on it; ported macros referencing Python-side methods not implemented here.
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
- Unknown method on adapter object
- Unknown method on BaseRelationObject
- Unknown method on ColumnStatic
- Unknown method on Exceptions
- Unknown method on StaticBaseRelationObject
AI-assisted analysis of dbt-labs/dbt-core@0267ce9170 (2026-09-07).
Data as JSON: /api/errors/48015a2dab08e700.
Report an issue: GitHub.
Appendix: source
Thrown at crates/dbt-adapter/src/relation/relation_object.rs:712
_listeners: &[std::rc::Rc<dyn RenderingEventListener>],
) -> Result<Value, minijinja::Error> {
match name {
"get_part" => {
let iter = ArgsIter::new("QuotePolicy.args", &[], args);
let name = iter.next_kwarg::<String>("name")?;
iter.finish()?;
match name.as_str() {
"database" => Ok(Value::from(self.0.database)),
"schema" => Ok(Value::from(self.0.schema)),
"identifier" => Ok(Value::from(self.0.identifier)),
_ => Err(minijinja::Error::new(
minijinja::ErrorKind::InvalidArgument,
format!("'{name}' is not a valid argument"),
)),
}
}
_ => Err(minijinja::Error::new(
minijinja::ErrorKind::UnknownMethod,
format!("Unknown method on DefaultQuotePolicyObject: '{name}'"),
)),
}
}
}
/// A Wrapper type for StaticBaseRelation
/// for any concrete StaticBaseRelation type to be used as Object in Jinja
/// to expose static methods via api.Relation
#[derive(Debug, Clone)]
pub struct StaticBaseRelationObject(Arc<dyn StaticBaseRelation>);
impl StaticBaseRelationObject {
pub fn new(relation: Arc<dyn StaticBaseRelation>) -> Self {
Self(relation)
}
}View on GitHub (pinned to 0267ce9170)