Skip to content

Commit

Permalink
TST (string dtype): follow-up fix for pyarrow 19.0 update (#60764)
Browse files Browse the repository at this point in the history
* TST (string dtype): follow-up fix for pyarrow 19.0 update

* fix test
  • Loading branch information
jorisvandenbossche authored Jan 23, 2025
1 parent 60325b8 commit 222d7c7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pandas/tests/io/test_parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,7 @@ def fp(request):

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


@pytest.fixture
Expand Down Expand Up @@ -686,7 +683,11 @@ def test_parquet_read_from_url(self, httpserver, datapath, df_compat, engine):
with open(datapath("io", "data", "parquet", "simple.parquet"), mode="rb") as f:
httpserver.serve_content(content=f.read())
df = read_parquet(httpserver.url, engine=engine)
tm.assert_frame_equal(df, df_compat)

expected = df_compat
if pa_version_under19p0:
expected.columns = expected.columns.astype(object)
tm.assert_frame_equal(df, expected)


class TestParquetPyArrow(Base):
Expand Down

0 comments on commit 222d7c7

Please sign in to comment.