Skip to content

Commit d7ce449

Browse files
committed
fix: renable to_csv and to_json related tests
1 parent 4fbf938 commit d7ce449

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

tests/system/small/test_dataframe_io.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ def test_to_pandas_batches_w_correct_dtypes(scalars_df_default_index):
115115
pd.testing.assert_series_equal(actual, expected)
116116

117117

118-
@pytest.mark.skip(reason="Disable to unblock kokoro tests")
119118
@pytest.mark.parametrize(
120119
("index"),
121120
[True, False],
@@ -154,6 +153,7 @@ def test_to_csv_index(
154153
dtype=dtype,
155154
date_format={"timestamp_col": "YYYY-MM-DD HH:MM:SS Z"},
156155
index_col=index_col,
156+
storage_options=dict(expand=True),
157157
)
158158
convert_pandas_dtypes(gcs_df, bytes_col=True)
159159
gcs_df.index.name = scalars_df.index.name
@@ -164,7 +164,6 @@ def test_to_csv_index(
164164
pd.testing.assert_frame_equal(gcs_df, scalars_pandas_df)
165165

166166

167-
@pytest.mark.skip(reason="Disable to unblock kokoro tests")
168167
def test_to_csv_tabs(
169168
scalars_dfs: Tuple[bigframes.dataframe.DataFrame, pd.DataFrame],
170169
gcs_folder: str,
@@ -194,6 +193,7 @@ def test_to_csv_tabs(
194193
dtype=dtype,
195194
date_format={"timestamp_col": "YYYY-MM-DD HH:MM:SS Z"},
196195
index_col=index_col,
196+
storage_options=dict(expand=True),
197197
)
198198
convert_pandas_dtypes(gcs_df, bytes_col=True)
199199
gcs_df.index.name = scalars_df.index.name
@@ -415,7 +415,6 @@ def test_to_json_index_invalid_lines(
415415
scalars_df.to_json(path, index=index)
416416

417417

418-
@pytest.mark.skip(reason="Disable to unblock kokoro tests")
419418
@pytest.mark.parametrize(
420419
("index"),
421420
[True, False],
@@ -435,7 +434,12 @@ def test_to_json_index_records_orient(
435434
""" Test the `to_json` API with `orient` is `records` and `lines` is True"""
436435
scalars_df.to_json(path, index=index, orient="records", lines=True)
437436

438-
gcs_df = pd.read_json(path, lines=True, convert_dates=["datetime_col"])
437+
gcs_df = pd.read_json(
438+
path,
439+
lines=True,
440+
convert_dates=["datetime_col"],
441+
storage_options=dict(expand=True),
442+
)
439443
convert_pandas_dtypes(gcs_df, bytes_col=True)
440444
if index and scalars_df.index.name is not None:
441445
gcs_df = gcs_df.set_index(scalars_df.index.name)

tests/system/small/test_series.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2390,11 +2390,10 @@ def test_to_frame(scalars_dfs):
23902390
assert_pandas_df_equal(bf_result, pd_result)
23912391

23922392

2393-
@pytest.mark.skip(reason="Disable to unblock kokoro tests")
23942393
def test_to_json(gcs_folder, scalars_df_index, scalars_pandas_df_index):
23952394
path = gcs_folder + "test_series_to_json*.jsonl"
23962395
scalars_df_index["int64_col"].to_json(path, lines=True, orient="records")
2397-
gcs_df = pd.read_json(path, lines=True)
2396+
gcs_df = pd.read_json(path, lines=True, storage_options=dict(expand=True))
23982397

23992398
pd.testing.assert_series_equal(
24002399
gcs_df["int64_col"].astype(pd.Int64Dtype()),
@@ -2404,11 +2403,10 @@ def test_to_json(gcs_folder, scalars_df_index, scalars_pandas_df_index):
24042403
)
24052404

24062405

2407-
@pytest.mark.skip(reason="Disable to unblock kokoro tests")
24082406
def test_to_csv(gcs_folder, scalars_df_index, scalars_pandas_df_index):
24092407
path = gcs_folder + "test_series_to_csv*.csv"
24102408
scalars_df_index["int64_col"].to_csv(path)
2411-
gcs_df = pd.read_csv(path)
2409+
gcs_df = pd.read_csv(path, storage_options=dict(expand=True))
24122410

24132411
pd.testing.assert_series_equal(
24142412
gcs_df["int64_col"].astype(pd.Int64Dtype()),

0 commit comments

Comments
 (0)