Skip to content

Commit

Permalink
Backport PR pandas-dev#59306 on branch 2.2.x (CI: xfail test_to_read_…
Browse files Browse the repository at this point in the history
…gcs for pyarrow=17) (pandas-dev#59308)

Backport PR pandas-dev#59306: CI: xfail test_to_read_gcs for pyarrow=17

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
  • Loading branch information
meeseeksmachine and mroeschke authored Jul 25, 2024
1 parent 98ba07a commit f656d52
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pandas/tests/io/test_gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import numpy as np
import pytest

from pandas.compat.pyarrow import pa_version_under17p0

from pandas import (
DataFrame,
Index,
Expand Down Expand Up @@ -52,7 +54,7 @@ def ls(self, path, **kwargs):
# Patches pyarrow; other processes should not pick up change
@pytest.mark.single_cpu
@pytest.mark.parametrize("format", ["csv", "json", "parquet", "excel", "markdown"])
def test_to_read_gcs(gcs_buffer, format, monkeypatch, capsys):
def test_to_read_gcs(gcs_buffer, format, monkeypatch, capsys, request):
"""
Test that many to/read functions support GCS.
Expand Down Expand Up @@ -91,6 +93,13 @@ def from_uri(path):
to_local = pathlib.Path(path.replace("gs://", "")).absolute().as_uri()
return pa_fs.LocalFileSystem(to_local)

request.applymarker(
pytest.mark.xfail(
not pa_version_under17p0,
raises=TypeError,
reason="pyarrow 17 broke the mocked filesystem",
)
)
with monkeypatch.context() as m:
m.setattr(pa_fs, "FileSystem", MockFileSystem)
df1.to_parquet(path)
Expand Down

0 comments on commit f656d52

Please sign in to comment.