Skip to content

Commit

Permalink
fix: Raise on categorical search_sorted (#20395)
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 authored Dec 21, 2024
1 parent 0955b9a commit 15b8981
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/polars-ops/src/series/ops/search_sorted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ pub fn search_sorted(
descending: bool,
) -> PolarsResult<IdxCa> {
let original_dtype = s.dtype();

if s.dtype().is_categorical() {
polars_bail!(InvalidOperation: "'search_sorted' is not supported on dtype: {}", s.dtype())
}

let s = s.to_physical_repr();
let phys_dtype = s.dtype();

Expand Down

0 comments on commit 15b8981

Please sign in to comment.