-
-
Couldn't load subscription status.
- Fork 19.2k
BUG: Recognize 2-tuple state without attrs dict #62832
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
Conversation
|
I'm not sure whether to title the PR "CI" or "BUG". |
| if len(state) == 1 and isinstance(state[0], dict): | ||
| self.__setstate__(state[0]) | ||
| return | ||
| elif len(state) == 2: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a comment that this is hit with pyodide? Also were you able to find any sources why this happens?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also were you able to find any sources why this happens?
I can't be certain, but it looks likely to be caused by a difference in the Cython compiler version.
Here's how I reasoned:
1. Comparison of the action logs around the time the error occurred
I also suspected the pyodide-build version, but downgrading it myself made no difference. The same was true in #62822, and in the logs below there was even a counterexample where both Passed and Failed appeared on the same 0.30.7 version.
- Passed at
2025-10-22T17:00:
https://github.com/pandas-dev/pandas/actions/runs/18708950986/job/53352549298 - Failed at
2025-10-22T19:15:
https://github.com/pandas-dev/pandas/actions/runs/18712341219/job/53363529061
However, the Cython compiler versions were different: 3.1.5 -> 3.2.0
2. Cython Update
Around the same time, at 2025-10-22T18:49, a pre-release of Cython was published that includes an update related to pickling.
https://github.com/cython/cython/releases/tag/3.2.0b1-3
- In auto-pickling, trying to unpickle an object that has no
__dict__from object pickle data
that includes instance dict state is now an error.
(Github issue :issue:7222)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems likely that the condition was tightened in the PR below, so that empty dicts are no longer included in the state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a comment that this is hit with pyodide?
I added a comment. It doesn't seem to be the only cause of the pyodide, so I wrote it in general, and I wrote down the issue number so that it can be tracked instead. (1e6cd2f)
|
Thanks @heoh |
doc/source/whatsnew/vX.X.X.rstfile if fixing a bug or adding a new feature.Description
Fixes a
pickle.loadfailure discovered in pyodide CI (see #62820).Changed
NDArrayBacked.__setstate__to accept 2-tuple states. When a 2-tuple(data, dtype)is encountered, it is treated as(data, dtype, {})and normal restoration continues.