Skip to content

Commit 1cfded3

Browse files
Debian Science Teamrebecca-palmer
Debian Science Team
authored andcommitted
Fix pyreadstat and some xarray fails, test others
Tests failing with newer xarray and/or pyreadstat Author: Richard Shadrach, Rebecca N. Palmer <[email protected]> Origin: partly pandas-dev/pandas#60109 Bug: partly pydata/xarray#9661 Bug-Debian: https://bugs.debian.org/1088988 Forwarded: no Gbp-Pq: Name 1088988_xarray_pyreadstat_compat.patch
1 parent 83fa7ba commit 1cfded3

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

pandas/tests/generic/test_to_xarray.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ def test_to_xarray_index_types(self, index_flat, df, using_infer_string):
5252
# datetimes w/tz are preserved
5353
# column names are lost
5454
expected = df.copy()
55-
expected["f"] = expected["f"].astype(
56-
object if not using_infer_string else "string[pyarrow_numpy]"
57-
)
55+
# breaks in xarray >= 2024.10.0(?)
56+
# debug print
57+
r0 = result.to_dataframe()
58+
print("expected",expected, expected.index, expected.dtypes, "actual",result, r0, r0.index, r0.dtypes,sep='\n')
5859
expected.columns.name = None
5960
tm.assert_frame_equal(result.to_dataframe(), expected)
6061

pandas/tests/io/test_spss.py

+2
Original file line numberDiff line numberDiff line change
@@ -162,4 +162,6 @@ def test_spss_metadata(datapath):
162162
"modification_time": datetime.datetime(2015, 2, 6, 14, 33, 36),
163163
}
164164
)
165+
if Version(pyreadstat.__version__) >= Version("1.2.8"):
166+
metadata["mr_sets"] = {}
165167
assert df.attrs == metadata

0 commit comments

Comments
 (0)