dbt-labs/dbt-core · error

has no method named

Error message

{} has no method named '{}'

What it means

Catch-all arm of DataType's Jinja method dispatch: only cast, csvify and jsonify are implemented, so any other method name invoked on a DataType value raises this UnknownMethod-style error naming the type and the missing method.

Solutions

  1. Use one of the supported methods: cast, csvify, jsonify
  2. Fix the method-name typo in the template
  3. Extend the match arm when adding new DataType methods
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at crates/dbt-agate/src/data_type.rs:203 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at crates/dbt-agate/src/data_type.rs:203

                let d = as_data_type("d", name, d)?;
                self.0.cast(d)
            }
            "csvify" => {
                let args_iter = ArgsIter::new(name, &["d"], args);
                let d = args_iter.next_arg::<&Value>()?;
                args_iter.finish()?;

                Ok(self.0.csvify(d))
            }
            "jsonify" => {
                let args_iter = ArgsIter::new(name, &["d"], args);
                let d = args_iter.next_arg::<&Value>()?;
                args_iter.finish()?;

                Ok(self.0.jsonify(d))
            }
            _ => Err(Error::new(
                ErrorKind::UnknownMethod,
                format!("{} has no method named '{}'", self.0.type_name(), name),
            )),
        }
    }

    fn render(self: &Arc<Self>, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        fmt::Display::fmt(self, f)
    }
}

#[derive(Debug, Clone)]
struct DataTypeReprImpl {
    null_values: NullValues<'static>,
    /// The name of the data type ("Text", "Number", "Boolean", "Date", "DateTime", "TimeDelta")
    type_name: String,
}

View on GitHub (pinned to 0267ce9170)