From 7a6f324a528335937ba99ee221c08d37408b6f2f Mon Sep 17 00:00:00 2001 From: Alenka Frim Date: Thu, 20 Apr 2023 15:08:43 +0200 Subject: [PATCH] GH-35235: [CI][Python] Pandas upstream_devel and nightlies are failing (#35248) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Closes: #35235 Lead-authored-by: Alenka Frim Co-authored-by: Alenka Frim Co-authored-by: Joris Van den Bossche Signed-off-by: Raúl Cumplido --- python/pyarrow/table.pxi | 2 +- python/pyarrow/tests/test_pandas.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/python/pyarrow/table.pxi b/python/pyarrow/table.pxi index ede3c39ca9631..e8baa79250002 100644 --- a/python/pyarrow/table.pxi +++ b/python/pyarrow/table.pxi @@ -467,7 +467,7 @@ cdef class ChunkedArray(_PandasConvertible): # pandas ExtensionDtype that implements conversion from pyarrow if hasattr(pandas_dtype, '__from_arrow__'): arr = pandas_dtype.__from_arrow__(self) - return pandas_api.series(arr) + return pandas_api.series(arr, name=self._name) return _array_like_to_pandas(self, options, types_mapper=types_mapper) diff --git a/python/pyarrow/tests/test_pandas.py b/python/pyarrow/tests/test_pandas.py index 60c483164a0f9..a49552aa0a218 100644 --- a/python/pyarrow/tests/test_pandas.py +++ b/python/pyarrow/tests/test_pandas.py @@ -1438,6 +1438,13 @@ def test_timestamp_to_pandas_ns(self): def test_timestamp_to_pandas_out_of_bounds(self): # ARROW-7758 check for out of bounds timestamps for non-ns timestamps + if Version(pd.__version__) >= Version("2.1.0.dev"): + # GH-35235: test fail due to __from_pyarrow__ being added to pandas + # https://github.com/pandas-dev/pandas/pull/52201 + # Needs: https://github.com/apache/arrow/issues/33321 + pytest.skip( + "Need support converting to non-nano datetime64 for pandas >= 2.0") + for unit in ['s', 'ms', 'us']: for tz in [None, 'America/New_York']: arr = pa.array([datetime(1, 1, 1)], pa.timestamp(unit, tz=tz))