From d16da78288cada31b7a1d21b5f88178de81ad0dd Mon Sep 17 00:00:00 2001 From: Karthikeyan Natarajan Date: Fri, 3 Feb 2023 18:15:41 +0530 Subject: [PATCH] update pytest --- python/cudf/cudf/tests/test_json.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/python/cudf/cudf/tests/test_json.py b/python/cudf/cudf/tests/test_json.py index 81acb43ee7d..b778db4465f 100644 --- a/python/cudf/cudf/tests/test_json.py +++ b/python/cudf/cudf/tests/test_json.py @@ -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)