{"record":{"id":"ccc0850f28b1ed97","repo":"dbt-labs/dbt-core","slug":"method-method-not-found","errorCode":null,"errorMessage":"Method {method} not found","messagePattern":"Method (.+?) not found","errorType":"exception","errorClass":"minijinja::Error (InvalidOperation)","httpStatus":null,"severity":"error","filePath":"crates/dbt-jinja-vars/src/var.rs","lineNumber":152,"sourceCode":"        args: &[Value],\n        _listeners: &[Rc<dyn RenderingEventListener>],\n    ) -> Result<Value, Error> {\n        let (var_name, default_value) = Self::parse_args(args)?;\n        self.call_as_function(state, var_name, default_value)\n    }\n\n    /// Common implementation for `Object::call_method`.\n    fn call_method_impl(\n        self: &Arc<Self>,\n        state: &State<'_, '_>,\n        method: &str,\n        args: &[Value],\n        _listeners: &[Rc<dyn RenderingEventListener>],\n    ) -> Result<Value, Error> {\n        if method == \"has_var\" {\n            self.call_has_var(state, args)\n        } else {\n            Err(Error::new(\n                ErrorKind::InvalidOperation,\n                format!(\"Method {method} not found\"),\n            ))\n        }\n    }\n}\n\n/// A struct that returns a variable from a map of variables (with optional overrides)\n/// https://github.com/dbt-labs/dbt-core/blob/31881d2a3bea030e700e9df126a3445298385698/core/dbt/context/base.py#L139\n#[derive(Debug)]\npub struct Var {\n    vars: BTreeMap<String, dbt_yaml::Value>,\n    overrides: Option<BTreeMap<String, dbt_yaml::Value>>,\n}\n\nimpl Var {\n    /// Make a new Var struct\n    pub fn new(vars: BTreeMap<String, dbt_yaml::Value>) -> Self {","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-jinja-vars/src/var.rs#L134-L170","documentation":"This object exposes only a single method, `has_var`; `call_method_impl` errors for any other method name invoked on it. It is the standard minijinja object-protocol fallback when an undefined method is called.","triggerScenarios":"Invoking any method other than `has_var` on this Jinja object, e.g. `{{ vars.get('x') }}`, `{{ vars.items() }}`, or misspellings like `{{ vars.hasvar('x') }}` / `{{ vars.has_var_x }}`.","commonSituations":"Treating the vars object like a Python dict (calling `.get`, `.keys`, `.items`); typo'd method names; expecting `has_var` to exist on a different context object.","solutions":["Use `has_var('name')` for existence checks and `var('name', default)` for value access.","Iterate supplied vars via the invocation `vars` argument (`dbt run --vars`), not via dict methods on this object.","Fix typos — the method name is exactly `has_var`."],"exampleFix":"// before (Jinja)\n{{ vars.get('my_var', 'default') }}\n// after\n{% if has_var('my_var') %}{{ var('my_var') }}{% else %}default{% endif %}","handlingStrategy":"validation","validationCode":"{% if not method_name in ['has_var'] %}{{ exceptions.raise_compiler_error('only has_var is supported') }}{% endif %}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use only has_var on this object; use var() for values","Do not treat the vars object as a Python dict (no .get/.keys/.items)","Consult the dbt context docs for the exact method surface"],"tags":["jinja","method-not-found","vars","dbt"],"backgroundTag":"unsupported-operation","analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}