Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-jsonpickle for 
openSUSE:Factory checked in at 2023-06-16 16:54:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-jsonpickle (Old)
 and      /work/SRC/openSUSE:Factory/.python-jsonpickle.new.15902 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-jsonpickle"

Fri Jun 16 16:54:56 2023 rev:11 rq:1093360 version:3.0.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-jsonpickle/python-jsonpickle.changes      
2023-01-24 20:31:59.736268158 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-jsonpickle.new.15902/python-jsonpickle.changes
   2023-06-16 16:56:07.938163374 +0200
@@ -1,0 +2,11 @@
+Wed Jun 14 10:48:59 UTC 2023 - Markéta Machová <mmach...@suse.com>
+
+- Add patch pandas2.patch to fix compatibility
+- Skip flaky test
+
+-------------------------------------------------------------------
+Sat Jun 10 17:30:51 UTC 2023 - ecsos <ec...@opensuse.org>
+
+- Add %{?sle15_python_module_pythons}
+
+-------------------------------------------------------------------

New:
----
  pandas2.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-jsonpickle.spec ++++++
--- /var/tmp/diff_new_pack.QrT6DD/_old  2023-06-16 16:56:08.622167409 +0200
+++ /var/tmp/diff_new_pack.QrT6DD/_new  2023-06-16 16:56:08.626167432 +0200
@@ -16,6 +16,7 @@
 #
 
 
+%{?sle15_python_module_pythons}
 Name:           python-jsonpickle
 Version:        3.0.1
 Release:        0
@@ -23,15 +24,14 @@
 License:        BSD-3-Clause
 URL:            https://github.com/jsonpickle/jsonpickle
 Source:         
https://files.pythonhosted.org/packages/source/j/jsonpickle/jsonpickle-%{version}.tar.gz
+# PATCH-FIX-UPSTREAM 
https://github.com/jsonpickle/jsonpickle/commit/a24240bfdec6a9d5172c2f25e19654d23ffc61e1
 Implement compatibility with pandas 2
+Patch:          pandas2.patch
 BuildRequires:  %{python_module base >= 3.7}
 BuildRequires:  %{python_module importlib_metadata if %python-base < 3.8}
 BuildRequires:  %{python_module setuptools_scm >= 3.4.1}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
-%if 0%{python_version_nodots} < 38
-Requires:       python-importlib_metadata
-%endif
 Recommends:     python-simplejson
 Suggests:       python-ujson
 Suggests:       python-numpy
@@ -68,7 +68,8 @@
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
 
 %check
-%pytest -ra
+# test_multindex_dataframe_roundtrip is flaky on i586
+%pytest -ra -k "not test_multindex_dataframe_roundtrip"
 
 %files %{python_files}
 %license LICENSE

++++++ pandas2.patch ++++++
>From a24240bfdec6a9d5172c2f25e19654d23ffc61e1 Mon Sep 17 00:00:00 2001
From: Theelx <43764914+the...@users.noreply.github.com>
Date: Fri, 26 May 2023 14:05:05 -0400
Subject: [PATCH] Implement compatibility with pandas 2

---
 jsonpickle/ext/pandas.py | 7 ++++++-
 requirements-dev.txt     | 2 +-
 setup.cfg                | 2 +-
 tests/pandas_test.py     | 2 +-
 4 files changed, 9 insertions(+), 4 deletions(-)

Index: jsonpickle-3.0.1/jsonpickle/ext/pandas.py
===================================================================
--- jsonpickle-3.0.1.orig/jsonpickle/ext/pandas.py
+++ jsonpickle-3.0.1/jsonpickle/ext/pandas.py
@@ -62,10 +62,13 @@ def make_read_csv_params(meta, context):
     parse_dates = []
     converters = {}
     timedeltas = []
+    # this is only for pandas v2+ due to a backwards-incompatible change
+    parse_datetime_v2 = {}
     dtype = {}
     for k, v in meta_dtypes.items():
         if v.startswith('datetime'):
             parse_dates.append(k)
+            parse_datetime_v2[k] = v
         elif v.startswith('complex'):
             converters[k] = complex
         elif v.startswith('timedelta'):
@@ -79,6 +82,7 @@ def make_read_csv_params(meta, context):
             dtype=dtype, header=header, parse_dates=parse_dates, 
converters=converters
         ),
         timedeltas,
+        parse_datetime_v2,
     )
 
 
@@ -104,7 +108,7 @@ class PandasDfHandler(BaseHandler):
 
     def restore(self, data):
         csv, meta = self.pp.restore_pandas(data)
-        params, timedeltas = make_read_csv_params(meta, self.context)
+        params, timedeltas, parse_datetime_v2 = make_read_csv_params(meta, 
self.context)
         # None makes it compatible with objects serialized before
         # column_levels_names has been introduced.
         column_level_names = meta.get('column_level_names', None)
@@ -115,6 +119,7 @@ class PandasDfHandler(BaseHandler):
         )
         for col in timedeltas:
             df[col] = pd.to_timedelta(df[col])
+        df = df.astype(parse_datetime_v2)
 
         df.set_index(decode(meta['index']), inplace=True)
         # restore the column level(s) name(s)
Index: jsonpickle-3.0.1/tests/pandas_test.py
===================================================================
--- jsonpickle-3.0.1.orig/tests/pandas_test.py
+++ jsonpickle-3.0.1/tests/pandas_test.py
@@ -62,7 +62,7 @@ def test_dataframe_roundtrip():
             'an_inf': np.array([np.inf] * 3),
             'a_str': np.str_('foo'),
             'a_unicode': np.unicode_('bar'),
-            'date': np.array([np.datetime64('2014-01-01')] * 3),
+            'date': np.array([np.datetime64('2014-01-01')] * 3, 
dtype="datetime64[s]"),
             'complex': np.complex_([1 - 2j, 2 - 1.2j, 3 - 1.3j]),
             # TODO: the following dtypes are not currently supported.
             # 'object': np.object_([{'a': 'b'}]*3),

Reply via email to