{"record":{"id":"44cebe5e879d6b4b","repo":"dbt-labs/dbt-core","slug":"invalid-config-object-specified","errorCode":null,"errorMessage":"Invalid config object specified","messagePattern":"Invalid config object specified","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-jinja-utils/src/phases/parse/resolve_model_context.rs","lineNumber":809,"sourceCode":"    ) -> Result<MinijinjaValue, MinijinjaError> {\n        let mut args = ArgParser::new(args, None);\n        // If there is a positional argument, it must be a map\n        let kwargs = if args.positional_len() == 1 {\n            let positional_val: MinijinjaValue = args.next_positional::<MinijinjaValue>()?;\n            if positional_val.kind() != ValueKind::Map {\n                return Err(MinijinjaError::new(\n                    MinijinjaErrorKind::InvalidOperation,\n                    format!(\n                        \"Invalid config argument kind specified: {}\",\n                        positional_val.kind()\n                    ),\n                ));\n            }\n            positional_val\n                .as_object()\n                .unwrap()\n                .try_iter_pairs()\n                .expect(\"Invalid config object specified\")\n                .map(|(k, v)| {\n                    (\n                        k.as_str()\n                            .expect(\"Invalid config object specified. Keys must be strings\")\n                            .to_string(),\n                        v,\n                    )\n                })\n                .collect()\n        } else {\n            args.drain_kwargs()\n        };\n\n        self.apply_config(state, kwargs)\n    }\n\n    fn call_method(\n        self: &Arc<Self>,","sourceCodeStart":791,"sourceCodeEnd":827,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-jinja-utils/src/phases/parse/resolve_model_context.rs#L791-L827","documentation":"When processing a `{{ config(...) }}` call at parse time, a positional argument is expected to be an iterable object of key/value pairs; `try_iter_pairs()` is unwrapped with `expect('Invalid config object specified')`. The panic fires when the positional config argument is an object that cannot be iterated as pairs (e.g. a non-dict object, or a scalar that slipped past the earlier object check).","triggerScenarios":"Calling `{{ config(some_object) }}` where the object is not a plain dict — e.g. a minijinja native object, a function, a struct-like value, or a nested/odd type returned by a macro that passes the `as_object()` check but not pair iteration.","commonSituations":"Macros returning custom objects into config(); passing a list or string positionally to config(); users passing `config(kwargs)` where kwargs was rebuilt into an unsupported type.","solutions":["Ensure the positional argument to `{{ config(...) }}` is a plain dict with string keys, e.g. `{{ config(materialized='table') }}` or `{{ config({'materialized': 'table'}) }}`","If a macro builds the config, have it return a normal dict (not a custom object)","Log/print the value in the model to see its actual type before the config call","At the code level, replace expect with an error message that includes the received value's type"],"exampleFix":"// before (model.sql)\n{{ config(some_macro_that_returns_object()) }}\n// after\n{% set cfg = some_macro_that_returns_dict() %}\n{{ config(cfg) }}","handlingStrategy":"validation","validationCode":"{% set cfg = my_config_arg() %}\n{% if cfg is not mapping %}\n  {{ exceptions.raise_compiler_error(\"config() positional arg must be a dict, got: \" ~ type(cfg)) }}\n{% endif %}\n{{ config(cfg) }}","typeGuard":"// in jinja: only pass mappings\n{% if cfg is mapping %}{{ config(cfg) }}{% endif %}","tryCatchPattern":"// in Rust, replace expect with a descriptive error\nobj.try_iter_pairs().ok_or_else(|| MinijinjaError::new(\n    ErrorKind::InvalidOperation, \"config() positional arg must be an iterable dict\"))?;","preventionTips":["Call config() with keyword args or plain dicts only","Ensure macros building configs return plain dicts","Use `is mapping` tests in jinja before passing values to config()","Avoid passing lists/scalars positionally to config()"],"tags":["panic","config","jinja","type-mismatch","parse"],"backgroundTag":"invalid-argument-value","analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}