Skip to content

Commit

Permalink
Don't panic.
Browse files Browse the repository at this point in the history
  • Loading branch information
pythonspeed committed Jan 2, 2025
1 parent 7ee4ede commit 3179992
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/polars-ops/src/series/ops/index_of.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ pub fn index_of(series: &Series, needle: Scalar) -> PolarsResult<Option<usize>>
}

if series.dtype().is_categorical() {
unimplemented!("Categorical index_of() can give incorrect result until https://github.com/pola-rs/polars/issues/20318 is fixed")
// See https://github.com/pola-rs/polars/issues/20318
polars_bail!(InvalidOperation: "index_of() on Categoricals is not supported");
}

// For non-numeric dtypes, we convert to row-encoding, which essentially has
Expand Down

0 comments on commit 3179992

Please sign in to comment.