dbt-labs/dbt-core · error

column_sorted

Error message

column_sorted

What it means

Unimplemented agate Table method: column_sorted should return the single column sorted ascending, but the body is a todo!() stub after extracting the column via single_column_table. Any caller (Jinja macro or table helper) invoking column_sorted aborts here.

Solutions

  1. Sort the extracted column's values with a total-order comparator honoring agate type ordering
  2. Reuse the same comparator as the future rows/order-by implementation
  3. Return an unsupported error instead of todo!() in the interim
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at crates/dbt-agate/src/table.rs:235 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/d8ad9849fe5a2569. Report an issue: GitHub.

Appendix: source

Thrown at crates/dbt-agate/src/table.rs:235

        let row_names = self.row_names.as_ref().map(Arc::clone);
        let repr = TableRepr::new(flat_with_single_column, None, row_names);
        Some(Arc::new(repr))
    }

    /// Return a single-column table with the distinct values in this column.
    pub fn column_distinct(&self, col_idx: isize) -> Arc<Self> {
        let _col = self.single_column_table(col_idx).unwrap();
        todo!("column_distinct")
    }

    pub fn column_without_nulls(&self, col_idx: isize) -> Arc<Self> {
        let _col = self.single_column_table(col_idx).unwrap();
        todo!("column_without_nulls")
    }

    pub fn column_sorted(&self, col_idx: isize) -> Arc<Self> {
        let _col = self.single_column_table(col_idx).unwrap();
        todo!("column_sorted")
    }

    pub fn column_without_nulls_sorted(&self, col_idx: isize) -> Arc<Self> {
        let _col = self.single_column_table(col_idx).unwrap();
        todo!("column_without_nulls_sorted")
    }

    pub fn count_occurrences_of_value_in_column(&self, _needle: &Value, col_idx: isize) -> usize {
        let _col = self.single_column_table(col_idx).unwrap();
        todo!("count_occurrences_of_value_in_column")
    }

    pub fn index_of_value_in_column(&self, _needle: &Value, col_idx: isize) -> Option<usize> {
        let _col = self.single_column_table(col_idx).unwrap();
        todo!("index_of_value_in_column")
    }

    fn with_renamed_columns(&self, renamed_columns: Vec<String>) -> Arc<Self> {

View on GitHub (pinned to 0267ce9170)