dbt-labs/dbt-core · error
{}
Error message
{} What it means
Column.get_name() (a Databricks-specific ColumnStatic Jinja method) expects a `column` keyword argument that can be deserialized into a DbtColumn struct. When the Jinja Value passed as `column` is not a dict-like object with the fields DbtColumn requires (at minimum `name`, optionally `quote`), minijinja's typed-struct deserialization fails and the library re-wraps it as a SerdeDeserializeError with message "{}". It signals that the wrong kind of value was passed to Column.get_name(), not a database or SQL problem.
Source
Thrown at crates/dbt-adapter/src/column/types.rs:103
let columns = args.get::<Value>("columns")?;
let columns = Column::vec_from_jinja_value(AdapterType::Databricks, columns)?;
Ok(Value::from(self.dbx_format_add_column_list(&columns)?))
}
"format_remove_column_list" => {
// TODO: ArgsIter
let mut args = ArgParser::new(args, None);
let columns = args.get::<Value>("columns")?;
let columns = Column::vec_from_jinja_value(AdapterType::Databricks, columns)?;
Ok(Value::from(self.dbx_format_remove_column_list(&columns)?))
}
"get_name" => {
let mut args: ArgParser = ArgParser::new(args, None);
let column = args.get::<Value>("column")?;
// FIXME: why is this DbtColumn and not Column?
let column = minijinja_value_to_typed_struct::<DbtColumn>(column).map_err(|e| {
minijinja::Error::new(
minijinja::ErrorKind::SerdeDeserializeError,
e.to_string(),
)
})?;
Ok(Value::from(self.dbx_get_name(&column)))
}
_ => Err(minijinja::Error::new(
minijinja::ErrorKind::UnknownMethod,
format!("Unknown method on ColumnStatic: '{name}'"),
)),
}
}
fn call(
self: &Arc<Self>,
_state: &minijinja::State,
args: &[Value],View on GitHub (pinned to 0267ce9170)
Solutions
- Pass a dict with at least the `name` key (and `quote` if desired): Column.get_name(column={'name': col_name, 'quote': True}).
- If you have a Column object from from_description/create, use its `name`/`quoted` attributes directly instead of get_name().
- Inspect the wrapped SerdeDeserializeError message (the `{}` payload) to see which field failed to deserialize and fix the dict keys/types.
- Ensure the call goes through the `column=` keyword; positional args are not read by ArgParser here.
Example fix
// before (Jinja)
{% set col = adapter.Column.from_description('id', 'INT') %}
{% set n = Column.get_name(column=col) %}
// after
{% set n = Column.get_name(column={'name': 'id', 'quote': false}) %} Defensive patterns
Strategy: validation
Validate before calling
// Jinja: verify the value is a dict with a name before calling
{% if column is mapping and column.name is defined %}
{% set n = Column.get_name(column=column) %}
{% else %}
{{ exceptions.raise_compiler_error("get_name requires a column dict with a 'name' field") }}
{% endif %} Type guard
fn is_column_dict(v: &minijinja::Value) -> bool {
v.as_object().map(|o| o.get_attr("name").map(|n| !n.is_undefined()).unwrap_or(false)).unwrap_or(false)
} Prevention
- Always pass the node-level column dict (with `name`/`quote`), not a Column object.
- Use the `column=` keyword argument explicitly.
- In macros, assert the column dict shape early with exceptions.raise_compiler_error.
- Track DbtColumn schema changes when upgrading dbt versions.
When it happens
Trigger: Calling `Column.get_name(column=...)` from a Jinja materialization/macro with: (1) no `column` keyword arg at all, (2) a non-dict value (string, number, list, Column object instead of a node-column dict), or (3) a dict missing required DbtColumn fields such as `name`.
Common situations: Adapter materialization macros (e.g. Databricks) passing an API Column object instead of the raw node column dict; a renamed/missing field in a custom macro that builds the column dict by hand; passing results of `columns` iteration where items are already Column objects; version drift where DbtColumn gained a required field.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- Failed to downcast jinja value to Column; expected Column ob
- existing_columns must contain Column objects
- Unknown method on ColumnStatic: '{name}'
- {msg}
- render_constraints_for_create is only available for Databric
AI-assisted analysis of dbt-labs/dbt-core@0267ce9170 (2026-09-07).
Data as JSON: /api/errors/3e96194134e0c827.
Report an issue: GitHub.