Skip to content

Commit 222d7c7

Browse files
TST (string dtype): follow-up fix for pyarrow 19.0 update (#60764)
* TST (string dtype): follow-up fix for pyarrow 19.0 update * fix test
1 parent 60325b8 commit 222d7c7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pandas/tests/io/test_parquet.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,7 @@ def fp(request):
104104

105105
@pytest.fixture
106106
def df_compat():
107-
# TODO(infer_string) should this give str columns?
108-
return pd.DataFrame(
109-
{"A": [1, 2, 3], "B": "foo"}, columns=pd.Index(["A", "B"], dtype=object)
110-
)
107+
return pd.DataFrame({"A": [1, 2, 3], "B": "foo"}, columns=pd.Index(["A", "B"]))
111108

112109

113110
@pytest.fixture
@@ -686,7 +683,11 @@ def test_parquet_read_from_url(self, httpserver, datapath, df_compat, engine):
686683
with open(datapath("io", "data", "parquet", "simple.parquet"), mode="rb") as f:
687684
httpserver.serve_content(content=f.read())
688685
df = read_parquet(httpserver.url, engine=engine)
689-
tm.assert_frame_equal(df, df_compat)
686+
687+
expected = df_compat
688+
if pa_version_under19p0:
689+
expected.columns = expected.columns.astype(object)
690+
tm.assert_frame_equal(df, expected)
690691

691692

692693
class TestParquetPyArrow(Base):

0 commit comments

Comments
 (0)