Skip to content

Commit

Permalink
Fix pyreadstat and some xarray fails, test others
Browse files Browse the repository at this point in the history
Tests failing with newer xarray and/or pyreadstat

Author: Richard Shadrach, Rebecca N. Palmer <rebecca_palmer@zoho.com>
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
  • Loading branch information
Debian Science Team authored and rebecca-palmer committed Feb 1, 2025
1 parent e4c117a commit 175e05e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pandas/tests/generic/test_to_xarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ def test_to_xarray_index_types(self, index_flat, df, using_infer_string):
# 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)

Expand Down
2 changes: 2 additions & 0 deletions pandas/tests/io/test_spss.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 175e05e

Please sign in to comment.