dbt-labs/dbt-core · error

Table.join: columns must be a sequence of column names

Error message

Table.join: columns must be a sequence of column names: {e}

What it means

selected_right_table_columns failed to deserialize the 'columns' argument of Table.join into a sequence of strings: the value is either not a list or its entries are not strings, so the right-table column selection for the join output can't be determined.

Solutions

  1. Pass a list of column-name strings, or omit 'columns' entirely (defaults to all non-key columns)
  2. Ensure right-table column names are strings, coercing with |map('string') if needed
  3. Use Some([]) explicitly when no extra columns should be included
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at crates/dbt-agate/src/join.rs:108 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/cc30dbf164b1f9f5. Report an issue: GitHub.

Appendix: source

Thrown at crates/dbt-agate/src/join.rs:108

}

/// Parse the `columns` argument of the `Table.join` method.
///
// ```
// :param columns:
//     A sequence of column names from :code:`right_table` to include in
//     the final output table. Defaults to all columns not in
//     :code:`right_key`. Ignored when :code:`full_outer` is :code:`True`.
// ```
//
// `None` means "all columns not in right_key" (the default), `Some([])` means
// "no columns", and `Some([name1, name2, ...])` means "only these columns".
fn selected_right_table_columns(columns: Option<&Value>) -> Result<Option<Vec<String>>, Error> {
    let Some(columns) = columns else {
        return Ok(None);
    };
    let iter = columns.try_iter().map_err(|e| {
        Error::new(
            ErrorKind::InvalidArgument,
            format!("Table.join: columns must be a sequence of column names: {e}"),
        )
    })?;
    let mut names = Vec::new();
    for column in iter {
        match column.as_str() {
            Some(name) => names.push(name.to_string()),
            None => {
                return Err(Error::new(
                    ErrorKind::InvalidArgument,
                    format!(
                        "Table.join: columns must be a sequence of column names: {column} found instead"
                    ),
                ));
            }
        }
    }

View on GitHub (pinned to 0267ce9170)