Fix pyreadstat and some xarray fails, test others
authorDebian Science Team <debian-science-maintainers@lists.alioth.debian.org>
Sat, 1 Feb 2025 18:39:17 +0000 (18:39 +0000)
committerRebecca N. Palmer <rebecca_palmer@zoho.com>
Sat, 1 Feb 2025 18:39:17 +0000 (18:39 +0000)
Tests failing with newer xarray and/or pyreadstat

Author: Richard Shadrach, Rebecca N. Palmer <rebecca_palmer@zoho.com>
Origin: partly https://github.com/pandas-dev/pandas/pull/60109
Bug: partly https://github.com/pydata/xarray/issues/9661
Bug-Debian: https://bugs.debian.org/1088988
Forwarded: no

Gbp-Pq: Name 1088988_xarray_pyreadstat_compat.patch

pandas/tests/generic/test_to_xarray.py
pandas/tests/io/test_spss.py

index 2bd235c4f1a29e674521454a0485c5eee0b73d93..56579f309adb3a062aa0a604315e89ceef5c57a6 100644 (file)
@@ -52,9 +52,10 @@ class TestDataFrameToXArray:
         # datetimes w/tz are preserved
         # column names are lost
         expected = df.copy()
-        expected["f"] = expected["f"].astype(
-            object if not using_infer_string else "string[pyarrow_numpy]"
-        )
+        # breaks in xarray >= 2024.10.0(?)
+        # debug print
+        r0 = result.to_dataframe()
+        print("expected",expected, expected.index, expected.dtypes, "actual",result, r0, r0.index, r0.dtypes,sep='\n')
         expected.columns.name = None
         tm.assert_frame_equal(result.to_dataframe(), expected)
 
index d40128192a64f3626c25769d1d0bf6b817516902..3b8e0be3e37c781af55a4b7e1b15b4fdbb7adabd 100644 (file)
@@ -162,4 +162,6 @@ def test_spss_metadata(datapath):
                 "modification_time": datetime.datetime(2015, 2, 6, 14, 33, 36),
             }
         )
+    if Version(pyreadstat.__version__) >= Version("1.2.8"):
+        metadata["mr_sets"] = {}
     assert df.attrs == metadata