Skip to content

Commit

Permalink
update pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikeyann committed Feb 3, 2023
1 parent ea041a3 commit d16da78
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions python/cudf/cudf/tests/test_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,23 @@ def test_json_writer(tmpdir, pdf, gdf):
assert_eq(pdf_string, gdf_string)


def test_cudf_json_writer(pdf):
@pytest.mark.parametrize(
"lines", [True, False], ids=["lines=True", "lines=False"]
)
def test_cudf_json_writer(pdf, lines):
# removing datetime column because pandas doesn't support it
for col_name in pdf.columns:
if "datetime" in col_name:
pdf.drop(col_name, axis=1, inplace=True)
gdf = cudf.DataFrame.from_pandas(pdf)
pdf_string = pdf.to_json(orient="records", lines=True)
gdf_string = gdf.to_json(orient="records", lines=True, engine="cudf")
pdf_string = pdf.to_json(orient="records", lines=lines)
gdf_string = gdf.to_json(orient="records", lines=lines, engine="cudf")

assert_eq(pdf_string, gdf_string)

gdf_string = gdf.to_json(
orient="records", lines=lines, engine="cudf", rows_per_chunk=8
)

assert_eq(pdf_string, gdf_string)

Expand Down

0 comments on commit d16da78

Please sign in to comment.