#15 [WIP] update to 2.2.0
Opened 5 months ago by jonathanspw. Modified 5 months ago
rpms/ jonathanspw/python-pandas rawhide  into  rawhide

file modified
+1
@@ -39,3 +39,4 @@ 

  /pandas-1.5.1.tar.gz

  /pandas-1.5.2.tar.gz

  /pandas-1.5.3.tar.gz

+ /pandas-2.0.0.tar.gz

file removed
-70
@@ -1,70 +0,0 @@ 

- From a7a17abcd9f03651ae07a0aa138668fd49287466 Mon Sep 17 00:00:00 2001

- From: "Benjamin A. Beasley" <code@musicinmybrain.net>

- Date: Fri, 25 Nov 2022 09:06:56 -0500

- Subject: [PATCH] TST: Fix some little-endian assumptions

- 

- See previous PR#46681.

- ---

-  pandas/tests/arrays/floating/test_arithmetic.py  |  2 +-

-  pandas/tests/frame/methods/test_to_records.py    | 14 ++++++++++++--

-  pandas/tests/scalar/timedelta/test_arithmetic.py |  2 +-

-  3 files changed, 14 insertions(+), 4 deletions(-)

- 

- diff --git a/pandas/tests/arrays/floating/test_arithmetic.py b/pandas/tests/arrays/floating/test_arithmetic.py

- index ec7419d6346a8..fdf2b00bdbac1 100644

- --- a/pandas/tests/arrays/floating/test_arithmetic.py

- +++ b/pandas/tests/arrays/floating/test_arithmetic.py

- @@ -162,7 +162,7 @@ def test_error_invalid_values(data, all_arithmetic_operators):

-              "not all arguments converted during string formatting",

-              "can't multiply sequence by non-int of type 'float'",

-              "ufunc 'subtract' cannot use operands with types dtype",

- -            r"ufunc 'add' cannot use operands with types dtype\('<M8\[ns\]'\)",

- +            rf"ufunc 'add' cannot use operands with types dtype\('{tm.ENDIAN}M8\[ns\]'\)",

-              r"ufunc 'add' cannot use operands with types dtype\('float\d{2}'\)",

-              "cannot subtract DatetimeArray from ndarray",

-          ]

- diff --git a/pandas/tests/frame/methods/test_to_records.py b/pandas/tests/frame/methods/test_to_records.py

- index 32cccddc9d515..701063c277226 100644

- --- a/pandas/tests/frame/methods/test_to_records.py

- +++ b/pandas/tests/frame/methods/test_to_records.py

- @@ -96,7 +96,13 @@ def test_to_records_index_name(self):

-              + [np.asarray(df.iloc[:, i]) for i in range(3)],

-              dtype={

-                  "names": ["A", "level_1", "0", "1", "2"],

- -                "formats": ["O", "O", "<f8", "<f8", "<f8"],

- +                "formats": [

- +                    "O",

- +                    "O",

- +                    f"{tm.ENDIAN}f8",

- +                    f"{tm.ENDIAN}f8",

- +                    f"{tm.ENDIAN}f8",

- +                ],

-              },

-          )

-          tm.assert_numpy_array_equal(result, expected)

- @@ -123,7 +129,11 @@ def test_to_records_index_dtype(self):

-                  ("2022-01-01", "2022-01-01", "2022-01-01"),

-                  ("2022-01-02", "2022-01-02", "2022-01-02"),

-              ],

- -            dtype=[("1", "<M8[ns]"), ("2", "<M8[ns]"), ("3", "<M8[ns]")],

- +            dtype=[

- +                ("1", f"{tm.ENDIAN}M8[ns]"),

- +                ("2", f"{tm.ENDIAN}M8[ns]"),

- +                ("3", f"{tm.ENDIAN}M8[ns]"),

- +            ],

-          )

-  

-          result = df.to_records(index=False)

- diff --git a/pandas/tests/scalar/timedelta/test_arithmetic.py b/pandas/tests/scalar/timedelta/test_arithmetic.py

- index 1c3868bc85fd5..526b558ecb813 100644

- --- a/pandas/tests/scalar/timedelta/test_arithmetic.py

- +++ b/pandas/tests/scalar/timedelta/test_arithmetic.py

- @@ -435,7 +435,7 @@ def test_td_mul_td64_ndarray_invalid(self):

-  

-          msg = (

-              "ufunc '?multiply'? cannot use operands with types "

- -            r"dtype\('<m8\[ns\]'\) and dtype\('<m8\[ns\]'\)"

- +            rf"dtype\('{tm.ENDIAN}m8\[ns\]'\) and dtype\('{tm.ENDIAN}m8\[ns\]'\)"

-          )

-          with pytest.raises(TypeError, match=msg):

-              td * other

@@ -1,97 +0,0 @@ 

- From e73d4d29203dab20e001beb1090d07683de583d6 Mon Sep 17 00:00:00 2001

- From: Patrick Hoefler <61934744+phofl@users.noreply.github.com>

- Date: Sat, 28 Jan 2023 08:37:26 -0500

- Subject: [PATCH] Backport PR #50925 on branch 1.5.x (TST: Remove fsspec

-  internals from tests) (#51038)

- 

- TST: Remove fsspec internals from tests (#50925)

- 

- Co-authored-by: Thomas Li <47963215+lithomas1@users.noreply.github.com>

- ---

-  pandas/tests/io/test_fsspec.py |  2 --

-  pandas/tests/io/test_gcs.py    | 24 +++++-------------------

-  2 files changed, 5 insertions(+), 21 deletions(-)

- 

- diff --git a/pandas/tests/io/test_fsspec.py b/pandas/tests/io/test_fsspec.py

- index 4f033fd63f978..fd1b30eca449e 100644

- --- a/pandas/tests/io/test_fsspec.py

- +++ b/pandas/tests/io/test_fsspec.py

- @@ -50,10 +50,8 @@ def test_read_csv(cleared_fs, df1):

-  

-  

-  def test_reasonable_error(monkeypatch, cleared_fs):

- -    from fsspec import registry

-      from fsspec.registry import known_implementations

-  

- -    registry.target.clear()

-      with pytest.raises(ValueError, match="nosuchprotocol"):

-          read_csv("nosuchprotocol://test/test.csv")

-      err_msg = "test error message"

- diff --git a/pandas/tests/io/test_gcs.py b/pandas/tests/io/test_gcs.py

- index 6907d8978e603..538969b7e226c 100644

- --- a/pandas/tests/io/test_gcs.py

- +++ b/pandas/tests/io/test_gcs.py

- @@ -22,17 +22,12 @@

-  @pytest.fixture

-  def gcs_buffer(monkeypatch):

-      """Emulate GCS using a binary buffer."""

- -    from fsspec import (

- -        AbstractFileSystem,

- -        registry,

- -    )

- -

- -    registry.target.clear()  # remove state

- +    import fsspec

-  

-      gcs_buffer = BytesIO()

-      gcs_buffer.close = lambda: True

-  

- -    class MockGCSFileSystem(AbstractFileSystem):

- +    class MockGCSFileSystem(fsspec.AbstractFileSystem):

-          def open(*args, **kwargs):

-              gcs_buffer.seek(0)

-              return gcs_buffer

- @@ -41,7 +36,8 @@ def ls(self, path, **kwargs):

-              # needed for pyarrow

-              return [{"name": path, "type": "file"}]

-  

- -    monkeypatch.setattr("gcsfs.GCSFileSystem", MockGCSFileSystem)

- +    # Overwrites the default implementation from gcsfs to our mock class

- +    fsspec.register_implementation("gs", MockGCSFileSystem, clobber=True)

-  

-      return gcs_buffer

-  

- @@ -54,9 +50,6 @@ def test_to_read_gcs(gcs_buffer, format):

-  

-      GH 33987

-      """

- -    from fsspec import registry

- -

- -    registry.target.clear()  # remove state

-  

-      df1 = DataFrame(

-          {

- @@ -131,9 +124,6 @@ def test_to_csv_compression_encoding_gcs(gcs_buffer, compression_only, encoding)

-      GH 35677 (to_csv, compression), GH 26124 (to_csv, encoding), and

-      GH 32392 (read_csv, encoding)

-      """

- -    from fsspec import registry

- -

- -    registry.target.clear()  # remove state

-      df = tm.makeDataFrame()

-  

-      # reference of compressed and encoded file

- @@ -173,12 +163,8 @@ def test_to_csv_compression_encoding_gcs(gcs_buffer, compression_only, encoding)

-  @td.skip_if_no("gcsfs")

-  def test_to_parquet_gcs_new_file(monkeypatch, tmpdir):

-      """Regression test for writing to a not-yet-existent GCS Parquet file."""

- -    from fsspec import (

- -        AbstractFileSystem,

- -        registry,

- -    )

- +    from fsspec import AbstractFileSystem

-  

- -    registry.target.clear()  # remove state

-      df1 = DataFrame(

-          {

-              "int": [1, 3],

file modified
+20 -9
@@ -12,7 +12,7 @@ 

  %bcond_without single_tests

  

  Name:           python-pandas

- Version:        1.5.3

+ Version:        2.0.0

  Release:        1%{?dist}

  Summary:        Python library providing high-performance data analysis tools

  
@@ -74,10 +74,6 @@ 

  # The GitHub archive contains tests; the PyPI sdist does not.

  Source0:        https://github.com/pandas-dev/pandas/archive/v%{version}/pandas-%{version}.tar.gz

  

- # Fix some little-endian assumptions in the tests

- # https://github.com/pandas-dev/pandas/pull/49913

- Patch:          https://github.com/pandas-dev/pandas/pull/49913.patch

- 

  # [PATCH] Backport PR #50925 on branch 1.5.x (TST: Remove fsspec internals from

  # tests) (#51038)

  #
@@ -85,7 +81,7 @@ 

  # https://github.com/pandas-dev/pandas/commit/e73d4d29203dab20e001beb1090d07683de583d6

  #   fixes:

  # ERROR at setup of test_to_read_gcs[…]

- Patch:          https://github.com/pandas-dev/pandas/commit/e73d4d29203dab20e001beb1090d07683de583d6.patch

+ #Patch:          https://github.com/pandas-dev/pandas/commit/e73d4d29203dab20e001beb1090d07683de583d6.patch

  

  %global _description %{expand:

  pandas is an open source, BSD-licensed library providing
@@ -242,8 +238,8 @@ 

  # We BR all weak dependencies to ensure they are installable.

  

  # Timezones

- BuildRequires:  tzdata >= 2022a

- Recommends:     tzdata >= 2022a

+ BuildRequires:  tzdata >= 2023c

+ Recommends:     tzdata >= 2023c

  

  # Visualization

  BuildRequires:  python3dist(matplotlib) >= 3.3.2
@@ -473,6 +469,9 @@ 

      setup.cfg

  %endif

  

+ # we don't need the python tzdata package because we have the system tzdata package

+ sed -i '/tzdata>=2022.1/d' pyproject.toml

+ 

  

  %generate_buildrequires

  %pyproject_buildrequires -r %{?with_tests:-x test}
@@ -636,6 +635,11 @@ 

  # https://github.com/pydata/xarray/blob/v2023.02.0/doc/whats-new.rst#breaking-changes-1

  # CFTimeIndex.get_loc() got an unexpected keyword argument 'method'

  k="${k-}${k+ and }not test_xarray_cftimeindex_nearest"

+ 

+ # this test fails with matplotlib > 3.6

+ # see https://github.com/pandas-dev/pandas/pull/51990#issuecomment-1470543796

+ # this PR is likely to eventually fix it upstream

+ k="${k-}${k+ and }not (TestDataFramePlots and test_plain_axes)"

  %endif

  

  %if 0%{?fc37}
@@ -646,6 +650,10 @@ 

  k="${k-}${k+ and }not (TestExpressions and test_run_binary)"

  %endif

  

+ # Skip some failing dask tests until it is updated in rawhide

+ # https://bugzilla.redhat.com/show_bug.cgi?id=2173223

+ k="${k-}${k+ and }not (test_dask or test_dask_ufunc)"

+ 

  # Ensure pytest doesn’t find the “un-built” library. We can get away with this

  # approach because the tests are also in the installed library. We can’t simply

  # “cd” to the buildroot’s python3_sitearch because testing leaves files in the
@@ -669,7 +677,7 @@ 

  # 32-bit platforms (%%if 0%%{?__isa_bits} == 32) it may be necessary to limit

  # the number of concurrent tests to e.g. 8 in order to prevent memory

  # exhaustion.

- %constrain_build -c 1

+ %constrain_build -c 8

  

  %pytest -v '%{buildroot}%{python3_sitearch}/pandas' \

      %{?!with_slow_tests:--skip-slow} \
@@ -709,6 +717,9 @@ 

  

  

  %changelog

+ * Mon Apr 03 2023 Jonathan Wright <jonathan@almalinux.org> - 2.0.0-1

+ - Update to 2.0.0 rhbz#2179146

+ 

  * Mon Feb 27 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.5.3-1

  - Update to 1.5.3 (close RHBZ#2162303)

  

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (pandas-1.5.3.tar.gz) = 220ec6923ebc1d0063537d8a62f53a8ce2631c35c1f3f5b63ee892617507603553db69a2d06f8cd338366e008f746994c3420ee58d151df1b94f5b5719b03b43

+ SHA512 (pandas-2.0.0.tar.gz) = 1324984c7218fc6c555cbcbd03a71e0201d74075680f191ecf596faace4009f2664d806105f53490be1ad314a9c6bf4b3b6e3690f67cd55e70e9fb9694a4cb10

Need to look into some failing tests on s390 and i686

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/34803b997ef74c359fb3feee66307378