diff --git a/py-polars/polars/expr/expr.py b/py-polars/polars/expr/expr.py index 775a6d42372b..ec65f40af0d7 100644 --- a/py-polars/polars/expr/expr.py +++ b/py-polars/polars/expr/expr.py @@ -5724,21 +5724,14 @@ def xor(self, other: Any) -> Expr: """ return self.__xor__(other) - def is_in( - self, other: Expr | Collection[Any] | Series, *, strict: bool = True - ) -> Expr: + def is_in(self, other: Expr | Collection[Any] | Series) -> Expr: """ Check if elements of this expression are present in the other Series. Parameters ---------- other - Series or sequence to test membership of. - strict - If a python collection is given, `strict` - will be passed to the `Series` constructor - and indicates how different types should be - handled. + Series or sequence of primitive type. Returns ------- @@ -5765,7 +5758,7 @@ def is_in( if isinstance(other, Collection) and not isinstance(other, str): if isinstance(other, (Set, FrozenSet)): other = list(other) - other = F.lit(pl.Series(other, strict=strict))._pyexpr + other = F.lit(pl.Series(other))._pyexpr else: other = parse_into_expression(other) return self._from_pyexpr(self._pyexpr.is_in(other)) diff --git a/py-polars/polars/series/series.py b/py-polars/polars/series/series.py index 146e3f61c601..10a4ff21a99c 100644 --- a/py-polars/polars/series/series.py +++ b/py-polars/polars/series/series.py @@ -3703,20 +3703,10 @@ def is_not_nan(self) -> Series: ] """ - def is_in(self, other: Series | Collection[Any], *, strict: bool = True) -> Series: + def is_in(self, other: Series | Collection[Any]) -> Series: """ Check if elements of this Series are in the other Series. - Parameters - ---------- - other - Series or sequence to test membership of. - strict - If a python collection is given, `strict` - will be passed to the `Series` constructor - and indicates how different types should be - handled. - Returns ------- Series diff --git a/py-polars/tests/unit/operations/test_is_first_last_distinct.py b/py-polars/tests/unit/operations/test_is_first_last_distinct.py index bbef3208e825..00a6e0a5f259 100644 --- a/py-polars/tests/unit/operations/test_is_first_last_distinct.py +++ b/py-polars/tests/unit/operations/test_is_first_last_distinct.py @@ -156,8 +156,3 @@ def test_is_first_last_distinct_all_null(dtypes: PolarsDataType) -> None: s = pl.Series([None, None, None], dtype=dtypes) assert s.is_first_distinct().to_list() == [True, False, False] assert s.is_last_distinct().to_list() == [False, False, True] - - -def test_is_in_non_strict() -> None: - s = pl.Series([1, 2, 3, 4]) - assert s.is_in([2, 2.5], strict=False).to_list() == [False, True, False, False]