dbt-labs/dbt-core · error

count_occurrences_of_value_in_row

Error message

count_occurrences_of_value_in_row

What it means

Unimplemented agate Table method: count_occurrences_of_value_in_row should count how often a needle Value appears within one row (located by row index, already fetched via row_by_index), but the body is a todo!() stub.

Solutions

  1. Iterate the fetched row's cells counting agate-equal matches
  2. Guard the row index with a bounds error before counting
  3. Return an unsupported error instead of panicking until implemented
Defensive patterns

Strategy: fallback

When it happens

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

Appendix: source

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

            tuple
        })
    }

    pub fn count_occurrences_of_row(&self, _needle: &Value) -> usize {
        todo!("count_occurrences_of_row")
    }

    pub fn index_of_row(&self, _needle: &Value) -> Option<usize> {
        todo!("index_of_row")
    }

    pub fn count_occurrences_of_value_in_row(
        self: &Arc<Self>,
        _needle: &Value,
        row_idx: isize,
    ) -> usize {
        let _row = self.row_by_index(row_idx).unwrap();
        todo!("count_occurrences_of_value_in_row")
    }

    pub fn index_of_value_in_row(
        self: &Arc<Self>,
        _needle: &Value,
        row_idx: isize,
    ) -> Option<usize> {
        let _row = self.row_by_index(row_idx).unwrap();
        todo!("index_of_value_in_row")
    }

    pub(crate) fn limit(&self, n: i64) -> Result<TableRepr, ArrowError> {
        if n < 0 {
            return Err(ArrowError::ComputeError(
                "Table.limit: count must be non-negative".to_string(),
            ));
        }
        let take = (n as u64).min(self.num_rows() as u64);

View on GitHub (pinned to 0267ce9170)