Skip to content

Commit

Permalink
Test dtype deserialization error checking
Browse files Browse the repository at this point in the history
  • Loading branch information
wence- committed May 6, 2022
1 parent 63fede6 commit 94bc231
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions python/cudf/cudf/tests/test_serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,17 @@ def test_serialize(df, to_host):
assert_eq(a, b)


def test_serialize_dtype_error_checking():
dtype = cudf.IntervalDtype("float", "right")
header, frames = dtype.serialize()
with pytest.raises(AssertionError):
# Invalid number of frames
type(dtype).deserialize(header, [None] * (header["frame_count"] + 1))
with pytest.raises(AssertionError):
# mismatching class
cudf.StructDtype.deserialize(header, frames)


def test_serialize_dataframe():
df = cudf.DataFrame()
df["a"] = np.arange(100)
Expand Down

0 comments on commit 94bc231

Please sign in to comment.