Skip to content

Commit e3fd6bf

Browse files
committed
fix gcs file path
1 parent 0a39020 commit e3fd6bf

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

tests/system/small/test_dataframe_io.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,10 @@ def test_to_csv_index(
149149
# read_csv will decode into bytes inproperly, convert_pandas_dtypes will encode properly from string
150150
dtype.pop("bytes_col")
151151
gcs_df = pd.read_csv(
152-
path,
152+
path.replace("*", "000000000000"),
153153
dtype=dtype,
154154
date_format={"timestamp_col": "YYYY-MM-DD HH:MM:SS Z"},
155155
index_col=index_col,
156-
storage_options=dict(expand=True),
157156
)
158157
convert_pandas_dtypes(gcs_df, bytes_col=True)
159158
gcs_df.index.name = scalars_df.index.name
@@ -188,12 +187,11 @@ def test_to_csv_tabs(
188187
# read_csv will decode into bytes inproperly, convert_pandas_dtypes will encode properly from string
189188
dtype.pop("bytes_col")
190189
gcs_df = pd.read_csv(
191-
path,
190+
path.replace("*", "000000000000"),
192191
sep="\t",
193192
dtype=dtype,
194193
date_format={"timestamp_col": "YYYY-MM-DD HH:MM:SS Z"},
195194
index_col=index_col,
196-
storage_options=dict(expand=True),
197195
)
198196
convert_pandas_dtypes(gcs_df, bytes_col=True)
199197
gcs_df.index.name = scalars_df.index.name
@@ -435,10 +433,9 @@ def test_to_json_index_records_orient(
435433
scalars_df.to_json(path, index=index, orient="records", lines=True)
436434

437435
gcs_df = pd.read_json(
438-
path,
436+
path.replace("*", "000000000000"),
439437
lines=True,
440438
convert_dates=["datetime_col"],
441-
storage_options=dict(expand=True),
442439
)
443440
convert_pandas_dtypes(gcs_df, bytes_col=True)
444441
if index and scalars_df.index.name is not None:

tests/system/small/test_series.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2393,7 +2393,7 @@ def test_to_frame(scalars_dfs):
23932393
def test_to_json(gcs_folder, scalars_df_index, scalars_pandas_df_index):
23942394
path = gcs_folder + "test_series_to_json*.jsonl"
23952395
scalars_df_index["int64_col"].to_json(path, lines=True, orient="records")
2396-
gcs_df = pd.read_json(path, lines=True, storage_options=dict(expand=True))
2396+
gcs_df = pd.read_json(path.replace("*", "000000000000"), lines=True)
23972397

23982398
pd.testing.assert_series_equal(
23992399
gcs_df["int64_col"].astype(pd.Int64Dtype()),
@@ -2406,7 +2406,7 @@ def test_to_json(gcs_folder, scalars_df_index, scalars_pandas_df_index):
24062406
def test_to_csv(gcs_folder, scalars_df_index, scalars_pandas_df_index):
24072407
path = gcs_folder + "test_series_to_csv*.csv"
24082408
scalars_df_index["int64_col"].to_csv(path)
2409-
gcs_df = pd.read_csv(path, storage_options=dict(expand=True))
2409+
gcs_df = pd.read_csv(path.replace("*", "000000000000"))
24102410

24112411
pd.testing.assert_series_equal(
24122412
gcs_df["int64_col"].astype(pd.Int64Dtype()),

0 commit comments

Comments
 (0)