Skip to content

Commit 9857d31

Browse files
authored
Backport PR #61042: CI/TST: Fix xfail in test_columns_dtypes_not_invalid for pyarrow nightly (#61044)
* Backport PR #61042: CI/TST: Fix xfail in test_columns_dtypes_not_invalid for pyarrow nightly * remove xfail
1 parent 3ee2ffe commit 9857d31

File tree

2 files changed

+23
-16
lines changed

2 files changed

+23
-16
lines changed

pandas/compat/pyarrow.py

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
pa_version_under17p0 = _palv < Version("17.0.0")
2020
pa_version_under18p0 = _palv < Version("18.0.0")
2121
pa_version_under19p0 = _palv < Version("19.0.0")
22+
pa_version_under20p0 = _palv < Version("20.0.0")
2223
HAS_PYARROW = True
2324
except ImportError:
2425
pa_version_under10p1 = True
@@ -32,4 +33,5 @@
3233
pa_version_under17p0 = True
3334
pa_version_under18p0 = True
3435
pa_version_under19p0 = True
36+
pa_version_under20p0 = True
3537
HAS_PYARROW = False

pandas/tests/io/test_parquet.py

+21-16
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
pa_version_under13p0,
2121
pa_version_under15p0,
2222
pa_version_under19p0,
23+
pa_version_under20p0,
2324
)
2425

2526
import pandas as pd
@@ -1103,24 +1104,28 @@ def test_read_dtype_backend_pyarrow_config_index(self, pa):
11031104
expected=expected,
11041105
)
11051106

1106-
def test_columns_dtypes_not_invalid(self, pa):
1107+
@pytest.mark.parametrize(
1108+
"columns",
1109+
[
1110+
[0, 1],
1111+
pytest.param(
1112+
[b"foo", b"bar"],
1113+
marks=pytest.mark.xfail(
1114+
pa_version_under20p0,
1115+
raises=NotImplementedError,
1116+
reason="https://github.com/apache/arrow/pull/44171",
1117+
),
1118+
),
1119+
[
1120+
datetime.datetime(2011, 1, 1, 0, 0),
1121+
datetime.datetime(2011, 1, 1, 1, 1),
1122+
],
1123+
],
1124+
)
1125+
def test_columns_dtypes_not_invalid(self, pa, columns):
11071126
df = pd.DataFrame({"string": list("abc"), "int": list(range(1, 4))})
11081127

1109-
# numeric
1110-
df.columns = [0, 1]
1111-
check_round_trip(df, pa)
1112-
1113-
# bytes
1114-
df.columns = [b"foo", b"bar"]
1115-
with pytest.raises(NotImplementedError, match="|S3"):
1116-
# Bytes fails on read_parquet
1117-
check_round_trip(df, pa)
1118-
1119-
# python object
1120-
df.columns = [
1121-
datetime.datetime(2011, 1, 1, 0, 0),
1122-
datetime.datetime(2011, 1, 1, 1, 1),
1123-
]
1128+
df.columns = columns
11241129
check_round_trip(df, pa)
11251130

11261131
def test_empty_columns(self, pa):

0 commit comments

Comments
 (0)