From cc2003b42271a37538db32e5d438df14cc4075308490f9c490b09a010653b1ae Mon Sep 17 00:00:00 2001 From: Benjamin Greiner Date: Wed, 7 Jun 2023 09:09:42 +0000 Subject: [PATCH] Accepting request 1091231 from home:bnavigator:pyarrow - Skip invalid pandas 2 test * pyarrow-pr35822-pandas2-extensiontype.patch * gh#apache/arrow#35822 * gh#apache/arrow#35839 OBS-URL: https://build.opensuse.org/request/show/1091231 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pyarrow?expand=0&rev=6 --- pyarrow-pr35822-pandas2-extensiontype.patch | 54 +++++++++++++++++++++ python-pyarrow.changes | 8 +++ python-pyarrow.spec | 4 +- 3 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 pyarrow-pr35822-pandas2-extensiontype.patch diff --git a/pyarrow-pr35822-pandas2-extensiontype.patch b/pyarrow-pr35822-pandas2-extensiontype.patch new file mode 100644 index 0000000..290c435 --- /dev/null +++ b/pyarrow-pr35822-pandas2-extensiontype.patch @@ -0,0 +1,54 @@ +From 8dcbfff2f55cca5938ca6a094aab54c57d06bae0 Mon Sep 17 00:00:00 2001 +From: Joris Van den Bossche +Date: Tue, 25 Apr 2023 11:35:11 +0200 +Subject: [PATCH] [Python][CI] Skip extension type test failing with pandas + 2.0.1 + +--- + python/pyarrow/tests/test_extension_type.py | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/python/pyarrow/tests/test_extension_type.py b/python/pyarrow/tests/test_extension_type.py +index 44280ca95131b..090e22a746d51 100644 +--- a/python/pyarrow/tests/test_extension_type.py ++++ b/python/pyarrow/tests/test_extension_type.py +@@ -1296,8 +1296,10 @@ def test_extension_to_pandas_storage_type(registered_period_type): + assert result["ext"].dtype == pandas_dtype + + import pandas as pd +- if Version(pd.__version__) > Version("2.0.0"): +- ++ if ( ++ Version(pd.__version__) > Version("2.0.0") and ++ Version(pd.__version__) != Version("2.0.1") ++ ): + # Check the usage of types_mapper + result = table.to_pandas(types_mapper=pd.ArrowDtype) + assert isinstance(result["ext"].dtype, pd.ArrowDtype) + +From efe901b97911ad05e1767843add211c918983e8b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ra=C3=BAl=20Cumplido?= +Date: Tue, 30 May 2023 14:41:34 +0200 +Subject: [PATCH] GH-35821: [Python][CI] Skip extension type test failing with + pandas 2.0.2 + +--- + python/pyarrow/tests/test_extension_type.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/python/pyarrow/tests/test_extension_type.py b/python/pyarrow/tests/test_extension_type.py +index 4ef6573179e45..023968b20df46 100644 +--- a/python/pyarrow/tests/test_extension_type.py ++++ b/python/pyarrow/tests/test_extension_type.py +@@ -1299,9 +1299,9 @@ def test_extension_to_pandas_storage_type(registered_period_type): + assert result["ext"].dtype == pandas_dtype + + import pandas as pd ++ # Skip tests for 2.0.x, See: GH-35821 + if ( +- Version(pd.__version__) > Version("2.0.0") and +- Version(pd.__version__) != Version("2.0.1") ++ Version(pd.__version__) >= Version("2.1.0") + ): + # Check the usage of types_mapper + result = table.to_pandas(types_mapper=pd.ArrowDtype) diff --git a/python-pyarrow.changes b/python-pyarrow.changes index cf17d90..4a43186 100644 --- a/python-pyarrow.changes +++ b/python-pyarrow.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Jun 7 07:39:44 UTC 2023 - Ben Greiner + +- Skip invalid pandas 2 test + * pyarrow-pr35822-pandas2-extensiontype.patch + * gh#apache/arrow#35822 + * gh#apache/arrow#35839 + ------------------------------------------------------------------- Thu May 18 07:28:28 UTC 2023 - Ben Greiner diff --git a/python-pyarrow.spec b/python-pyarrow.spec index fdf825d..7152283 100644 --- a/python-pyarrow.spec +++ b/python-pyarrow.spec @@ -30,6 +30,8 @@ Source: https://files.pythonhosted.org/packages/source/p/pyarrow/pyarrow Source10: LICENSE.txt Source11: NOTICE.txt Source99: python-pyarrow.rpmlintrc +# PATCH-FIX-UPSTREAM pyarrow-pr35822-pandas2-extensiontype.patch gh#apache/arrow#35822, gh#apache/arrow#35839 +Patch0: pyarrow-pr35822-pandas2-extensiontype.patch BuildRequires: %{python_module Cython >= 0.29.31} BuildRequires: %{python_module devel} BuildRequires: %{python_module numpy-devel >= 1.16.6} @@ -93,7 +95,7 @@ This package provides the header files within the python platlib for consuming modules using cythonization. %prep -%setup -q -n pyarrow-%{version} +%autosetup -p2 -n pyarrow-%{version} cp %{SOURCE10} %{SOURCE11} ./ # we disabled the jemalloc backend in apache-arrow sed -i 's/should_have_jemalloc = sys.platform == "linux"/should_have_jemalloc = False/' pyarrow/tests/test_memory.py