File: 1088988_xarray_pyreadstat_compat.patch

package info (click to toggle)
pandas 2.3.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 66,800 kB
  • sloc: python: 424,812; ansic: 9,190; sh: 264; xml: 102; makefile: 86
file content (25 lines) | stat: -rw-r--r-- 933 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Description: Fix some xarray fails, test others

Tests failing with newer xarray

Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Bug: partly https://github.com/pydata/xarray/issues/9661
Bug-Debian: https://bugs.debian.org/1088988
Forwarded: no

--- a/pandas/tests/generic/test_to_xarray.py
+++ b/pandas/tests/generic/test_to_xarray.py
@@ -54,9 +54,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 "str"
-        )
+        # 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)