Skip to content

Commit

Permalink
fix(python): add missing _NUMPY_AVAILABLE check in Series.__getitem__ (
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-beedie committed Oct 6, 2022
1 parent 082df8b commit 1a38e6b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion py-polars/polars/internals/series/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,11 @@ def __getitem__(
if (
is_bool_sequence(item)
or (isinstance(item, Series) and item.dtype == Boolean)
or (isinstance(item, np.ndarray) and item.dtype.kind == "b")
or (
_NUMPY_AVAILABLE
and isinstance(item, np.ndarray)
and item.dtype.kind == "b"
)
):
warnings.warn(
"passing a boolean mask to Series.__getitem__ is being deprecated; "
Expand Down

0 comments on commit 1a38e6b

Please sign in to comment.