Skip to content

Commit

Permalink
test raise unsupported type error
Browse files Browse the repository at this point in the history
  • Loading branch information
CanglongCl committed Apr 6, 2024
1 parent 222d4a9 commit dc4e22f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions py-polars/tests/unit/dataframe/test_df.py
Original file line number Diff line number Diff line change
Expand Up @@ -1419,6 +1419,18 @@ def test_dot_product() -> None:
assert isinstance(result, float)
assert result == 32.0

with pytest.raises(
pl.InvalidOperationError,
match="`dot` operation not supported for dtype `bool`"
):
pl.Series([True, False, False, True]) @ pl.Series([4, 5, 6, 7])

with pytest.raises(
pl.InvalidOperationError,
match="`dot` operation not supported for dtype `str`"
):
pl.Series([1, 2, 3, 4]) @ pl.Series(["True", "False", "False", "True"])


def test_hash_rows() -> None:
df = pl.DataFrame({"a": [1, 2, 3, 4], "b": [2, 2, 2, 2]})
Expand Down

0 comments on commit dc4e22f

Please sign in to comment.