dbt-labs/dbt-core · error

' ' is not a valid argument

Error message

'{name}' is not a valid argument

What it means

This dispatcher handles attribute access on a quote-policy-like object that only exposes `database`, `schema`, and `identifier`. Any other attribute name raises this InvalidArgument error. It is raised at object-attribute lookup time from Jinja, not at ordinary function call time.

Solutions

  1. Only access `database`, `schema`, or `identifier` on this object.
  2. If you need other relation attributes, obtain them from the full relation object instead of this quoting/policy wrapper.
  3. Check for typos between the template attribute name and the three supported names.

Example fix

// before
{{ policy.quoting }}
// after
{{ policy.database }}.{{ policy.schema }}.{{ policy.identifier }}
Defensive patterns

Strategy: validation

Validate before calling

{% set allowed = ['database', 'schema', 'identifier'] %}
{% if attr not in allowed %}{% do log('attribute ' ~ attr ~ ' not available on quote policy', true) %}{% endif %}

Prevention

When it happens

Trigger: Accessing an attribute other than `database`, `schema`, or `identifier` on this object in a template, e.g. `policy.quoting` or `policy.name`.

Common situations: Template code assuming the object is a full relation (which has many more attributes) when it is actually a narrowed three-field quoting object; typos; accessing Python dbt fields like `quote_character` that are not ported.

Understand the failure class

Background: "must be a positive integer", "cannot be empty", "invalid argument": how invalid-argument errors work across open-source libraries — this error's family across 33 libraries.

Related errors


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

Appendix: source

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

impl Object for QuotePolicyObject {
    fn call_method(
        self: &Arc<Self>,
        _state: &State,
        name: &str,
        args: &[Value],
        _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>);

View on GitHub (pinned to 0267ce9170)