Skip to content

Commit

Permalink
Test for exception handling to_parquet with int96 and arrow schema en…
Browse files Browse the repository at this point in the history
…abled
  • Loading branch information
mhaseeb123 committed Jul 4, 2024
1 parent 649a92d commit b6a54ec
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions python/cudf/cudf/tests/test_parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -1617,12 +1617,10 @@ def test_parquet_writer_int96_timestamps(tmpdir, pdf, gdf):
assert_eq(pdf, gdf)

# Write out the gdf using the GPU accelerated writer with INT96 timestamps
# TODO: store_schema must be false when working with INT96 timestamps
gdf.to_parquet(
gdf_fname.strpath,
index=None,
int96_timestamps=True,
store_schema=False,
)

assert os.path.exists(gdf_fname)
Expand Down Expand Up @@ -3627,6 +3625,24 @@ def test_parquet_writer_roundtrip_with_arrow_schema(index):
assert_eq(expected, got3)


def test_parquet_writer_int96_timestamps_and_arrow_schema(index):
df = cudf.DataFrame(
{
"timestamp": cudf.Series(
[1234, 123, 4123], dtype="datetime64[ms]"
),
}
)

# Output buffer
buffer = BytesIO()

# Writing out parquet with both INT96 timestamps and arrow_schema
# enabled should throw an exception.
with pytest.raises(RuntimeError):
df.to_parquet(buffer, int96_timestamps=True, store_schema=True)


@pytest.mark.parametrize(
"data",
[
Expand Down

0 comments on commit b6a54ec

Please sign in to comment.