Skip to content

Commit

Permalink
fix(python): Fix issue in parametric testing where excluded_dtypes
Browse files Browse the repository at this point in the history
…list would grow indefinitely (pola-rs#16340)
  • Loading branch information
stinodego authored May 20, 2024
1 parent 9e3d614 commit 6dd4b3b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions py-polars/polars/testing/parametric/strategies/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,12 @@ def series( # noqa: D417

if isinstance(allowed_dtypes, (DataType, DataTypeClass)):
allowed_dtypes = [allowed_dtypes]
elif allowed_dtypes is not None and not isinstance(allowed_dtypes, Sequence):
elif allowed_dtypes is not None:
allowed_dtypes = list(allowed_dtypes)
if isinstance(excluded_dtypes, (DataType, DataTypeClass)):
excluded_dtypes = [excluded_dtypes]
elif excluded_dtypes is not None:
if not isinstance(excluded_dtypes, list):
excluded_dtypes = list(excluded_dtypes)
excluded_dtypes = list(excluded_dtypes)

if not allow_null and not (allowed_dtypes is not None and Null in allowed_dtypes):
if excluded_dtypes is None:
Expand Down

0 comments on commit 6dd4b3b

Please sign in to comment.