Skip to content

Commit

Permalink
Backport PR pandas-dev#59306: CI: xfail test_to_read_gcs for pyarrow=17
Browse files Browse the repository at this point in the history
  • Loading branch information
mroeschke authored and meeseeksmachine committed Jul 24, 2024
1 parent 98ba07a commit 569fd30
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 569fd30

Please sign in to comment.