Skip to content

Commit

Permalink
test invalid dtype raises
Browse files Browse the repository at this point in the history
  • Loading branch information
petrosbar committed Apr 19, 2024
1 parent fc35fba commit c65ffe4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions py-polars/tests/unit/datatypes/test_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -885,3 +885,11 @@ def test_list_product_and_dtypes() -> None:
).select(pl.col("a").list.product()).to_dict(as_series=False) == {
"a": [1, 1, 0, 1, 0]
}


def test_list_product_invalid_type_raises() -> None:
with pytest.raises(
pl.InvalidOperationError,
match="`list.product` operation not supported for dtype",
):
pl.Series("a", [["a", "b"]]).list.product()

0 comments on commit c65ffe4

Please sign in to comment.