{"record":{"id":"0c7391f4db3a5816","repo":"dbt-labs/dbt-core","slug":"get-common-options-failed-to-deserialize-internal","errorCode":null,"errorMessage":"get_common_options: Failed to deserialize InternalDbtNodeWrapper: {e}","messagePattern":"get_common_options: Failed to deserialize InternalDbtNodeWrapper: (.+?)","errorType":"exception","errorClass":"minijinja::Error::SerdeDeserializeError","httpStatus":null,"severity":"error","filePath":"crates/dbt-adapter/src/adapter/mod.rs","lineNumber":2195,"sourceCode":"                let config_val = iter.next_arg::<&Value>()?;\n                let node_val = iter.next_arg::<&Value>()?;\n                let temporary = iter\n                    .next_kwarg::<Option<bool>>(\"temporary\")?\n                    .unwrap_or(false);\n                iter.finish()?;\n\n                let config = minijinja_value_to_typed_struct::<ModelConfig>(config_val.clone())\n                    .map_err(|e| {\n                        minijinja::Error::new(\n                            minijinja::ErrorKind::SerdeDeserializeError,\n                            format!(\"get_common_options: Failed to deserialize config: {e}\"),\n                        )\n                    })?;\n                let node = minijinja_value_to_typed_struct::<InternalDbtNodeWrapper>(\n                    node_val.clone(),\n                )\n                .map_err(|e| {\n                    minijinja::Error::new(\n                        minijinja::ErrorKind::SerdeDeserializeError,\n                        format!(\n                            \"get_common_options: Failed to deserialize InternalDbtNodeWrapper: {e}\"\n                        ),\n                    )\n                })?;\n\n                let options = adapter.get_common_options(state, config, &node, temporary)?;\n                Ok(options)\n            }\n            Parse(_) => Ok(none_value()),\n        }\n    }\n\n    /// Add time ingestion partition column\n    ///\n    /// https://github.com/dbt-labs/dbt-adapters/blob/main/dbt-bigquery/src/dbt/adapters/bigquery/impl.py#L259\n    ///","sourceCodeStart":2177,"sourceCodeEnd":2213,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adapter/src/adapter/mod.rs#L2177-L2213","documentation":"Raised by get_common_options() when the `node` argument fails to deserialize into InternalDbtNodeWrapper. The macro needs node metadata (relation info, config, resource type) to compute common options, so a non-conforming node value aborts with this SerdeDeserializeError and the serde reason appended.","triggerScenarios":"adapter.get_common_options(config, node, temporary=...) invoked with node = None, a scalar, a relation object, or a dict missing required InternalDbtNodeWrapper fields (e.g. after schema changes or hand-crafted test nodes).","commonSituations":"Custom incremental/table materializations passing the wrong context variable for node; partial node dicts in tests; version mismatch between templates and adapter crate.","solutions":["Inspect the appended serde error for the missing or mistyped node field.","Pass the real node object (e.g. `model` in a materialization) as the second argument.","If building nodes programmatically, serialize a full InternalDbtNodeWrapper rather than a partial dict.","Update templates and adapter together to avoid schema drift."],"exampleFix":"// before\n{% set opts = adapter.get_common_options(config.model, none) %}\n\n// after\n{% set opts = adapter.get_common_options(config.model, model) %}","handlingStrategy":"validation","validationCode":"{% if model is mapping and model.get('unique_id') is defined %}\n  {% set opts = adapter.get_common_options(config.model, model) %}\n{% endif %}","typeGuard":"fn is_node(val: &minijinja::Value) -> bool {\n    minijinja_value_to_typed_struct::<InternalDbtNodeWrapper>(val.clone()).is_ok()\n}","tryCatchPattern":null,"preventionTips":["Always pass the real node object as the second argument","Never pass None/undefined as node","Serialize complete node objects in programmatic use","Align template and adapter crate versions"],"tags":["deserialization","jinja","adapter"],"backgroundTag":"schema-validation-failed","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"}