dbt-labs/dbt-core · error

DecimalValue has no method named

Error message

DecimalValue has no method named {method}

What it means

DecimalValue's call_method first tries attribute lookup via get_value; if no attribute matched, there is no fallback implementation for decimal-specific methods yet (the TODO notes they are unimplemented), so the call raises UnknownMethod naming DecimalValue and the requested method.

Solutions

  1. Implement the needed decimal method (quantize, scale, etc.) in call_method
  2. Use arithmetic filters/operators instead of method calls in templates
  3. List available operations in the error to help template authors
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at crates/dbt-agate/src/decimal.rs:157 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/ac38fe34fc7b5fc1. Report an issue: GitHub.

Appendix: source

Thrown at crates/dbt-agate/src/decimal.rs:157

    fn is_true(self: &Arc<Self>) -> bool {
        !self.is_zero()
    }

    fn call_method(
        self: &Arc<Self>,
        state: &minijinja::State<'_, '_>,
        method: &str,
        args: &[Value],
        listeners: &[std::rc::Rc<dyn minijinja::listener::RenderingEventListener>],
    ) -> Result<Value, Error> {
        if let Some(value) = self.get_value(&Value::from(method)) {
            return value.call(state, args, listeners);
        }

        // TODO: implement decimal methods

        Err(Error::new(
            minijinja::ErrorKind::UnknownMethod,
            format!("DecimalValue has no method named {method}"),
        ))
    }
}

#[cfg(test)]
mod tests {
    use super::*;
    use arrow::datatypes::Decimal128Type;

    #[test]
    fn decimal_value_truthiness_tracks_zero_state() {
        let zero = Arc::new(DecimalValue::<Decimal128Type>::new(0, 10, 2));
        assert!(zero.is_zero());
        assert!(!zero.is_true());

        let value = Arc::new(DecimalValue::<Decimal128Type>::new(12345, 10, 2));

View on GitHub (pinned to 0267ce9170)