Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pandas/_libs/arrays.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ cdef class NDArrayBacked:
if len(state) == 1 and isinstance(state[0], dict):
self.__setstate__(state[0])
return
elif len(state) == 2:
Copy link
Member

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?

Copy link
Contributor Author

@heoh heoh Oct 25, 2025

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.

image

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)

Copy link
Contributor Author

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.

https://github.com/cython/cython/pull/7222/files#diff-81caf3d8e52e1f4c815d4b94458252dcb181f86d3a24ee9f33759a5072837a5bL2335-L2337

Copy link
Contributor Author

@heoh heoh Oct 25, 2025

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)

self.__setstate__((*state, {}))
return
raise NotImplementedError(state) # pragma: no cover

data, dtype = state[:2]
Expand Down
Loading