From 04666fb180bfd2836023d7624d4332656f76f7269695873c1bcfe00d3a43315c Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sat, 24 Dec 2022 10:44:42 +0000 Subject: [PATCH] Accepting request 1045082 from home:bnavigator:branches:devel:languages:python:numeric - Update to version 1.5.2 ## Fixed regressions * Fixed regression in MultiIndex.join() for extension array dtypes (GH49277) * Fixed regression in Series.replace() raising RecursionError with numeric dtype and when specifying value=None (GH45725) * Fixed regression in arithmetic operations for DataFrame with MultiIndex columns with different dtypes (GH49769) * Fixed regression in DataFrame.plot() preventing Colormap instance from being passed using the colormap argument if Matplotlib 3.6+ is used (GH49374) * Fixed regression in date_range() returning an invalid set of periods for CustomBusinessDay frequency and start date with timezone (GH49441) * Fixed performance regression in groupby operations (GH49676) * Fixed regression in Timedelta constructor returning object of wrong type when subclassing Timedelta (GH49579) ## Bug fixes * Bug in the Copy-on-Write implementation losing track of views in certain chained indexing cases (GH48996) * Fixed memory leak in Styler.to_excel() (GH49751) ## Other * Reverted color as an alias for c and size as an alias for s in function DataFrame.plot.scatter() (GH49732) - Add pandas-pr49886-fix-numpy-deprecations.patch * gh#pandas-dev/pandas#49887 - Move to PEP518 build OBS-URL: https://build.opensuse.org/request/show/1045082 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pandas?expand=0&rev=78 --- pandas-1.5.1.tar.gz | 3 - pandas-1.5.2.tar.gz | 3 + pandas-pr49886-fix-numpy-deprecations.patch | 125 ++++++++++++++++++++ python-pandas.changes | 31 +++++ python-pandas.spec | 83 ++++++++----- 5 files changed, 211 insertions(+), 34 deletions(-) delete mode 100644 pandas-1.5.1.tar.gz create mode 100644 pandas-1.5.2.tar.gz create mode 100644 pandas-pr49886-fix-numpy-deprecations.patch diff --git a/pandas-1.5.1.tar.gz b/pandas-1.5.1.tar.gz deleted file mode 100644 index e542c5d..0000000 --- a/pandas-1.5.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:249cec5f2a5b22096440bd85c33106b6102e0672204abd2d5c014106459804ee -size 5199286 diff --git a/pandas-1.5.2.tar.gz b/pandas-1.5.2.tar.gz new file mode 100644 index 0000000..3ff8017 --- /dev/null +++ b/pandas-1.5.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:220b98d15cee0b2cd839a6358bd1f273d0356bf964c1a1aeb32d47db0215488b +size 5201551 diff --git a/pandas-pr49886-fix-numpy-deprecations.patch b/pandas-pr49886-fix-numpy-deprecations.patch new file mode 100644 index 0000000..50136ff --- /dev/null +++ b/pandas-pr49886-fix-numpy-deprecations.patch @@ -0,0 +1,125 @@ +From a0e1b0c28dfccd9a3f9e9e2794ef109e950d1a08 Mon Sep 17 00:00:00 2001 +From: Patrick Hoefler <61934744+phofl@users.noreply.github.com> +Date: Thu, 24 Nov 2022 11:58:42 +0000 +Subject: [PATCH] Backport PR #49886: CI: Remove deprecated numpy dtype aliases + +--- + asv_bench/benchmarks/sparse.py | 4 ++-- + pandas/core/arrays/sparse/array.py | 4 ++-- + pandas/core/interchange/column.py | 2 +- + pandas/tests/arrays/sparse/test_indexing.py | 4 ++-- + pandas/tests/arrays/sparse/test_reductions.py | 2 +- + pandas/tests/arrays/sparse/test_unary.py | 4 ++-- + pandas/tests/io/excel/test_writers.py | 9 ++++----- + 7 files changed, 14 insertions(+), 15 deletions(-) + +Index: pandas-1.5.2/pandas/core/arrays/sparse/array.py +=================================================================== +--- pandas-1.5.2.orig/pandas/core/arrays/sparse/array.py ++++ pandas-1.5.2/pandas/core/arrays/sparse/array.py +@@ -728,7 +728,7 @@ class SparseArray(OpsMixin, PandasObject + dtype = SparseDtype(bool, self._null_fill_value) + if self._null_fill_value: + return type(self)._simple_new(isna(self.sp_values), self.sp_index, dtype) +- mask = np.full(len(self), False, dtype=np.bool8) ++ mask = np.full(len(self), False, dtype=np.bool_) + mask[self.sp_index.indices] = isna(self.sp_values) + return type(self)(mask, fill_value=False, dtype=dtype) + +@@ -1043,7 +1043,7 @@ class SparseArray(OpsMixin, PandasObject + if not key.fill_value: + return self.take(key.sp_index.indices) + n = len(self) +- mask = np.full(n, True, dtype=np.bool8) ++ mask = np.full(n, True, dtype=np.bool_) + mask[key.sp_index.indices] = False + return self.take(np.arange(n)[mask]) + else: +Index: pandas-1.5.2/pandas/core/interchange/column.py +=================================================================== +--- pandas-1.5.2.orig/pandas/core/interchange/column.py ++++ pandas-1.5.2/pandas/core/interchange/column.py +@@ -315,7 +315,7 @@ class PandasColumn(Column): + valid = invalid == 0 + invalid = not valid + +- mask = np.zeros(shape=(len(buf),), dtype=np.bool8) ++ mask = np.zeros(shape=(len(buf),), dtype=np.bool_) + for i, obj in enumerate(buf): + mask[i] = valid if isinstance(obj, str) else invalid + +Index: pandas-1.5.2/pandas/tests/arrays/sparse/test_indexing.py +=================================================================== +--- pandas-1.5.2.orig/pandas/tests/arrays/sparse/test_indexing.py ++++ pandas-1.5.2/pandas/tests/arrays/sparse/test_indexing.py +@@ -85,7 +85,7 @@ class TestGetitem: + + def test_getitem_bool_sparse_array(self): + # GH 23122 +- spar_bool = SparseArray([False, True] * 5, dtype=np.bool8, fill_value=True) ++ spar_bool = SparseArray([False, True] * 5, dtype=np.bool_, fill_value=True) + exp = SparseArray([np.nan, 2, np.nan, 5, 6]) + tm.assert_sp_array_equal(arr[spar_bool], exp) + +@@ -95,7 +95,7 @@ class TestGetitem: + tm.assert_sp_array_equal(res, exp) + + spar_bool = SparseArray( +- [False, True, np.nan] * 3, dtype=np.bool8, fill_value=np.nan ++ [False, True, np.nan] * 3, dtype=np.bool_, fill_value=np.nan + ) + res = arr[spar_bool] + exp = SparseArray([np.nan, 3, 5]) +Index: pandas-1.5.2/pandas/tests/arrays/sparse/test_reductions.py +=================================================================== +--- pandas-1.5.2.orig/pandas/tests/arrays/sparse/test_reductions.py ++++ pandas-1.5.2/pandas/tests/arrays/sparse/test_reductions.py +@@ -142,7 +142,7 @@ class TestReductions: + assert result == expected + + def test_bool_sum_min_count(self): +- spar_bool = SparseArray([False, True] * 5, dtype=np.bool8, fill_value=True) ++ spar_bool = SparseArray([False, True] * 5, dtype=np.bool_, fill_value=True) + res = spar_bool.sum(min_count=1) + assert res == 5 + res = spar_bool.sum(min_count=11) +Index: pandas-1.5.2/pandas/tests/arrays/sparse/test_unary.py +=================================================================== +--- pandas-1.5.2.orig/pandas/tests/arrays/sparse/test_unary.py ++++ pandas-1.5.2/pandas/tests/arrays/sparse/test_unary.py +@@ -59,9 +59,9 @@ class TestUnaryMethods: + tm.assert_sp_array_equal(exp, res) + + def test_invert_operator(self): +- arr = SparseArray([False, True, False, True], fill_value=False, dtype=np.bool8) ++ arr = SparseArray([False, True, False, True], fill_value=False, dtype=np.bool_) + exp = SparseArray( +- np.invert([False, True, False, True]), fill_value=True, dtype=np.bool8 ++ np.invert([False, True, False, True]), fill_value=True, dtype=np.bool_ + ) + res = ~arr + tm.assert_sp_array_equal(exp, res) +Index: pandas-1.5.2/pandas/tests/io/excel/test_writers.py +=================================================================== +--- pandas-1.5.2.orig/pandas/tests/io/excel/test_writers.py ++++ pandas-1.5.2/pandas/tests/io/excel/test_writers.py +@@ -496,15 +496,14 @@ class TestExcelWriter: + + tm.assert_frame_equal(df, recons) + +- @pytest.mark.parametrize("np_type", [np.bool8, np.bool_]) +- def test_bool_types(self, np_type, path): +- # Test np.bool8 and np.bool_ values read come back as float. +- df = DataFrame([1, 0, True, False], dtype=np_type) ++ def test_bool_types(self, path): ++ # Test np.bool_ values read come back as float. ++ df = DataFrame([1, 0, True, False], dtype=np.bool_) + df.to_excel(path, "test1") + + with ExcelFile(path) as reader: + recons = pd.read_excel(reader, sheet_name="test1", index_col=0).astype( +- np_type ++ np.bool_ + ) + + tm.assert_frame_equal(df, recons) diff --git a/python-pandas.changes b/python-pandas.changes index 1351489..5cadcc9 100644 --- a/python-pandas.changes +++ b/python-pandas.changes @@ -1,3 +1,34 @@ +------------------------------------------------------------------- +Fri Dec 23 16:22:18 UTC 2022 - Ben Greiner + +- Update to version 1.5.2 + ## Fixed regressions + * Fixed regression in MultiIndex.join() for extension array + dtypes (GH49277) + * Fixed regression in Series.replace() raising RecursionError + with numeric dtype and when specifying value=None (GH45725) + * Fixed regression in arithmetic operations for DataFrame with + MultiIndex columns with different dtypes (GH49769) + * Fixed regression in DataFrame.plot() preventing Colormap + instance from being passed using the colormap argument if + Matplotlib 3.6+ is used (GH49374) + * Fixed regression in date_range() returning an invalid set of + periods for CustomBusinessDay frequency and start date with + timezone (GH49441) + * Fixed performance regression in groupby operations (GH49676) + * Fixed regression in Timedelta constructor returning object of + wrong type when subclassing Timedelta (GH49579) + ## Bug fixes + * Bug in the Copy-on-Write implementation losing track of views + in certain chained indexing cases (GH48996) + * Fixed memory leak in Styler.to_excel() (GH49751) + ## Other + * Reverted color as an alias for c and size as an alias for s in + function DataFrame.plot.scatter() (GH49732) +- Add pandas-pr49886-fix-numpy-deprecations.patch + * gh#pandas-dev/pandas#49887 +- Move to PEP518 build + ------------------------------------------------------------------- Sat Oct 22 16:10:11 UTC 2022 - Arun Persaud diff --git a/python-pandas.spec b/python-pandas.spec index c8ac1b3..f6e62a1 100644 --- a/python-pandas.spec +++ b/python-pandas.spec @@ -39,64 +39,83 @@ %define psuffix %{nil} %bcond_with test %endif -%{?!python_module:%define python_module() python3-%{**}} -%define skip_python2 1 + Name: python-pandas%{psuffix} -Version: 1.5.1 +Version: 1.5.2 Release: 0 Summary: Python data structures for data analysis, time series, and statistics License: BSD-3-Clause Group: Development/Libraries/Python URL: https://pandas.pydata.org/ Source0: https://files.pythonhosted.org/packages/source/p/pandas/pandas-%{version}.tar.gz +# SourceRepository: https://github.com/pandas-dev/pandas +# PATCH-FIX-UPSTREAM pandas-pr49886-fix-numpy-deprecations.patch gh#pandas-dev/pandas#49886, gh#pandas-dev/pandas#49887 +Patch1: pandas-pr49886-fix-numpy-deprecations.patch BuildRequires: %{python_module Cython >= 0.29.32} -BuildRequires: %{python_module Jinja2 >= 3.0.0} BuildRequires: %{python_module devel >= 3.8} BuildRequires: %{python_module numpy-devel >= 1.20.3} -BuildRequires: %{python_module python-dateutil >= 2.8.1} -BuildRequires: %{python_module pytz >= 2020.1} +BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools >= 51.0.0} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: python-rpm-macros Requires: python-numpy >= 1.20.3 Requires: python-python-dateutil >= 2.8.1 Requires: python-pytz >= 2020.1 +# SECTION Optional dependencies +# https://pandas.pydata.org/docs/getting_started/install.html#optional-dependencies Recommends: python-Bottleneck >= 1.3.2 Recommends: python-numexpr >= 2.7.3 -Suggests: python-Jinja2 >= 3.0.0 -Suggests: python-PyMySQL >= 1.0.2 -Suggests: python-SQLAlchemy >= 1.4.16 -Suggests: python-XlsxWriter >= 1.2.2 -Suggests: python-beautifulsoup4 >= 4.9.3 -Suggests: python-blosc >= 1.21.0 -Suggests: python-fastparquet >= 0.4.0 -Suggests: python-fsspec >= 0.7.4 -Suggests: python-gcsfs >= 0.6.0 -Suggests: python-html5lib >= 1.1 -Suggests: python-lxml >= 4.6.3 +# Visualization Suggests: python-matplotlib >= 3.3.2 -Suggests: python-numba >= 0.53.1 -Suggests: python-openpyxl >= 3.0.7 -Suggests: python-pandas-gbq >= 0.15.0 -Suggests: python-psycopg2 >= 2.8.6 -Suggests: python-pyarrow >= 1.0.1 -Suggests: python-pyreadstat >= 1.1.2 -Suggests: python-qt5 -Suggests: python-s3fs >= 0.4.0 -Suggests: python-scipy >= 1.7.1 -Suggests: python-tables >= 3.6.1 +Suggests: python-Jinja2 >= 3.0.0 Suggests: python-tabulate >= 0.8.9 +# Computation +Suggests: python-scipy >= 1.7.1 +Suggests: python-numba >= 0.53.1 Suggests: python-xarray >= 0.19.0 +# Excel files Suggests: python-xlrd >= 2.0.1 Suggests: python-xlwt >= 1.3.0 +Suggests: python-XlsxWriter >= 1.2.2 +Suggests: python-openpyxl >= 3.0.7 +Suggests: python-pyxlb >= 1.0.8 +# HTML +Suggests: python-beautifulsoup4 >= 4.9.3 +Suggests: python-html5lib >= 1.1 +Suggests: python-lxml >= 4.6.3 +# SQL databases +Suggests: python-PyMySQL >= 1.0.2 +Suggests: python-SQLAlchemy >= 1.4.16 +Suggests: python-psycopg2 >= 2.8.6 +# Other data sources +Suggests: python-tables >= 3.6.1 +Suggests: python-blosc >= 1.21.0 Suggests: python-zlib +Suggests: python-fastparquet >= 0.4.0 +Suggests: python-pyarrow >= 1.0.1 +Suggests: python-pyreadstat >= 1.1.2 +# Access data in the cloud +Suggests: python-fsspec >= 2021.7.0 +Suggests: python-gcsfs >= 2021.7.0 +Suggests: python-pandas-gbq >= 0.15.0 +Suggests: python-s3fs >= 2021.08.0 +# Clipboard +Suggests: python-qt5 +Suggests: python-QtPy Suggests: xclip Suggests: xsel +# Compression +Suggests: python-Brotli >= 0.7.0 +Suggests: python-python-snappy >= 0.6.0 +Suggests: python-zstandard >= 0.15.2 +# /SECTION Obsoletes: python-pandas-doc < %{version} Provides: python-pandas-doc = %{version} %if %{with test} BuildRequires: %{python_module Bottleneck >= 1.3.2} +BuildRequires: %{python_module Jinja2 >= 3} BuildRequires: %{python_module SQLAlchemy >= 1.4.16} BuildRequires: %{python_module XlsxWriter >= 1.4.3} BuildRequires: %{python_module beautifulsoup4 >= 4.9.3} @@ -125,18 +144,18 @@ heterogeneous) and time series data. It is a high-level building block for doing data analysis in Python. %prep -%setup -q -n pandas-%{version} +%autosetup -p1 -n pandas-%{version} sed -i 's/--strict-data-files//' pyproject.toml %build %if !%{with test} export CFLAGS="%{optflags} -fno-strict-aliasing" -%python_build +%pyproject_wheel %endif %install %if !%{with test} -%python_install +%pyproject_install %{python_expand sed -i -e 's|"python", "-c",|"%{__$python}", "-c",|' %{buildroot}%{$python_sitearch}/pandas/tests/io/test_compression.py %fdupes %{buildroot}%{$python_sitearch} } @@ -163,6 +182,8 @@ export PYTHONHASHSEED=1 SKIP_TESTS="(test_misc and test_memory_usage and series and empty and index)" # pytest-xdist worker crash SKIP_TESTS+=" or test_pivot_number_of_levels_larger_than_int32" +# https://github.com/pandas-dev/pandas/pull/49777 -- removed in pandas 1.6+ +SKIP_TESTS+=" or test_constructor_signed_int_overflow_deprecation" # --skip-* arguments: Upstream's custom way to skip marked tests. These do not use pytest.mark. SKIP_ARGS="--skip-network" @@ -225,7 +246,7 @@ xvfb-run pytest-%{$python_bin_suffix} -v -n %{jobs} --dist=loadfile \ %license LICENSE %doc README.md RELEASE.md %{python_sitearch}/pandas/ -%{python_sitearch}/pandas-%{version}*-info +%{python_sitearch}/pandas-%{version}.dist-info %endif %changelog