Skip to content

Commit

Permalink
add tests from rapidsai#9159
Browse files Browse the repository at this point in the history
  • Loading branch information
galipremsagar committed Sep 14, 2021
1 parent ea4077c commit f11a180
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions python/dask_cudf/dask_cudf/io/tests/test_parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,3 +486,21 @@ def test_create_metadata_file_inconsistent_schema(tmpdir):
# before computing, and "int" after
dd.assert_eq(ddf1.compute(), ddf2)
dd.assert_eq(ddf1.compute(), ddf2.compute())


@pytest.mark.parametrize(
"data",
[
[[0], [1, 2], [3]],
[None, [1, 2], [3]],
[{"f1": 1}, {"f1": 0, "f2": "dog"}, {"f2": "cat"}],
[None, {"f1": 0, "f2": "dog"}, {"f2": "cat"}],
],
)
def test_cudf_dtypes_from_pandas(tmpdir, data):
# Simple test that we can read in list and struct types
fn = str(tmpdir.join("test.parquet"))
dfp = pd.DataFrame({"data": data})
dfp.to_parquet(fn, engine="pyarrow", index=True)
ddf2 = dask_cudf.read_parquet(fn)
dd.assert_eq(cudf.from_pandas(dfp), ddf2)

0 comments on commit f11a180

Please sign in to comment.