Skip to content

Commit

Permalink
Backport PR pandas-dev#56063: CI: Fix pyarrow nightly ci failure
Browse files Browse the repository at this point in the history
  • Loading branch information
phofl authored and meeseeksmachine committed Nov 19, 2023
1 parent 19bbe06 commit 9292551
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
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

0 comments on commit 9292551

Please sign in to comment.