Skip to content

Commit

Permalink
fix: Throw error for comparison of unequal length series
Browse files Browse the repository at this point in the history
  • Loading branch information
coastalwhite committed Sep 18, 2024
1 parent 25f84e4 commit 39f7b1a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/polars-core/src/series/comparison.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ macro_rules! impl_compare {
let (lhs, rhs) = ($self, $rhs);
validate_types(lhs.dtype(), rhs.dtype())?;

polars_ensure!(lhs.len() == rhs.len(), ShapeMismatch: "could not compare between two series of different length ({} != {})", lhs.len(), rhs.len());

#[cfg(feature = "dtype-categorical")]
match (lhs.dtype(), rhs.dtype()) {
(Categorical(_, _) | Enum(_, _), Categorical(_, _) | Enum(_, _)) => {
Expand Down

0 comments on commit 39f7b1a

Please sign in to comment.