Skip to content

Commit ebe35f5

Browse files
authored
Make test_json_writer compatible with pandas 3 (rapidsai#21015)
Missed this in rapidsai#20803 for backward compatible changes with pandas 3 Authors: - Matthew Roeschke (https://github.com/mroeschke) - GALI PREM SAGAR (https://github.com/galipremsagar) Approvers: - GALI PREM SAGAR (https://github.com/galipremsagar) URL: rapidsai#21015
1 parent e7d2d75 commit ebe35f5

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

python/cudf/cudf/tests/input_output/test_json.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2018-2025, NVIDIA CORPORATION.
1+
# SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION.
22
# SPDX-License-Identifier: Apache-2.0
33

44
import copy
@@ -143,8 +143,8 @@ def test_json_writer(tmp_path, pdf, gdf):
143143
pdf_df_fname = tmp_path / "pdf_df.json"
144144
gdf_df_fname = tmp_path / "gdf_df.json"
145145

146-
pdf.to_json(pdf_df_fname)
147-
gdf.to_json(gdf_df_fname)
146+
pdf.to_json(pdf_df_fname, date_format="iso")
147+
gdf.to_json(gdf_df_fname, date_format="iso")
148148

149149
assert os.path.exists(pdf_df_fname)
150150
assert os.path.exists(gdf_df_fname)
@@ -158,8 +158,8 @@ def test_json_writer(tmp_path, pdf, gdf):
158158
pdf_series_fname = tmp_path / f"{column}_pdf_series.json"
159159
gdf_series_fname = tmp_path / f"{column}_gdf_series.json"
160160

161-
pdf[column].to_json(pdf_series_fname)
162-
gdf[column].to_json(gdf_series_fname)
161+
pdf[column].to_json(pdf_series_fname, date_format="iso")
162+
gdf[column].to_json(gdf_series_fname, date_format="iso")
163163

164164
assert os.path.exists(pdf_series_fname)
165165
assert os.path.exists(gdf_series_fname)
@@ -170,8 +170,8 @@ def test_json_writer(tmp_path, pdf, gdf):
170170
assert_eq(expect_series, got_series)
171171

172172
# Make sure results align for regular strings, not just files
173-
pdf_string = pdf[column].to_json()
174-
gdf_string = pdf[column].to_json()
173+
pdf_string = pdf[column].to_json(date_format="iso")
174+
gdf_string = pdf[column].to_json(date_format="iso")
175175
assert_eq(pdf_string, gdf_string)
176176

177177

0 commit comments

Comments
 (0)