Skip to content

Backport PR #56063 on branch 2.1.x (CI: Fix pyarrow nightly ci failure) #56069

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pandas/compat/pyarrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
pa_version_under13p0 = _palv < Version("13.0.0")
pa_version_under14p0 = _palv < Version("14.0.0")
pa_version_under14p1 = _palv < Version("14.0.1")
pa_version_under15p0 = _palv < Version("15.0.0")
except ImportError:
pa_version_under7p0 = True
pa_version_under8p0 = True
Expand All @@ -27,3 +28,4 @@
pa_version_under13p0 = True
pa_version_under14p0 = True
pa_version_under14p1 = True
pa_version_under15p0 = True
7 changes: 6 additions & 1 deletion pandas/tests/io/test_parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
pa_version_under8p0,
pa_version_under11p0,
pa_version_under13p0,
pa_version_under15p0,
)

import pandas as pd
Expand Down Expand Up @@ -755,7 +756,10 @@ def test_unsupported_float16(self, pa):
# Not able to write float 16 column using pyarrow.
data = np.arange(2, 10, dtype=np.float16)
df = pd.DataFrame(data=data, columns=["fp16"])
self.check_external_error_on_write(df, pa, pyarrow.ArrowException)
if pa_version_under15p0:
self.check_external_error_on_write(df, pa, pyarrow.ArrowException)
else:
check_round_trip(df, pa)

@pytest.mark.xfail(
is_platform_windows(),
Expand All @@ -764,6 +768,7 @@ def test_unsupported_float16(self, pa):
"dtypes are passed to_parquet function in windows"
),
)
@pytest.mark.skipif(not pa_version_under15p0, reason="float16 works on 15")
@pytest.mark.parametrize("path_type", [str, pathlib.Path])
def test_unsupported_float16_cleanup(self, pa, path_type):
# #44847, #44914
Expand Down