Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiindex + cftimeindex broken on pandas main #9878

Open
dcherian opened this issue Dec 11, 2024 · 1 comment
Open

multiindex + cftimeindex broken on pandas main #9878

dcherian opened this issue Dec 11, 2024 · 1 comment

Comments

@dcherian
Copy link
Contributor

dcherian commented Dec 11, 2024

What happened?

This test fails on pandas main branch

@requires_cftime
def test_multiindex():
index = xr.cftime_range("2001-01-01", periods=100, calendar="360_day")
mindex = pd.MultiIndex.from_arrays([index])
assert mindex.get_loc("2001-01") == slice(0, 30)

I will xfail this test but it would be good to fix it

cc @spencerkclark

@dcherian dcherian added the bug label Dec 11, 2024
dcherian added a commit to dcherian/xarray that referenced this issue Dec 11, 2024
1. Fix numpy formatting test
2. xfail cftimeindex test (pydata#9878)
dcherian added a commit to dcherian/xarray that referenced this issue Dec 11, 2024
1. Fix numpy formatting test (Closes pydata#9873)
2. xfail cftimeindex test (pydata#9878)

Closes pydata#9810
dcherian added a commit to dcherian/xarray that referenced this issue Dec 11, 2024
1. Fix numpy formatting test (Closes pydata#9873)
2. xfail cftimeindex test (pydata#9878)

Closes pydata#9810
@spencerkclark
Copy link
Member

Thanks @dcherian—a bisect indicates pandas-dev/pandas#60118 led to this. I think the issue is that uniques is being cast to a plain Index instead of a CFTimeIndex. Previously the constructor of self was used, which would create a CFTimeIndex. I'll think about the best way to address this upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants