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
tests/pandas_test.py::test_timedelta_index_roundtrip fails when pandas are built with Cython-3 #460
Comments
Got it. I'll try and fix it tonight but I can't guarantee it'll be done. Is there a deadline by which any Linux distros need a working version? Also, is pinning Cython to <3 a feasible temporary solution? |
Not really but numpy released an RC yesterday that requires Cython>=3.0, so it would be nice to fix it sooner than later. That said, I don't think this functionality is really critical right now, so there's no explicit hurry.
We'd actually have to pin pandas on our end. Please don't add pins to jsonpickle because that won't affect pandas at all. |
I've been investigating this, and it seems like it could be related to this commit (though I'm not 100% sure). The dict in the error you got is |
Pandas upstream actually still pins to Cython <3 in its released/tagged versions, but has moved on to Cython 3 in the development branch. |
Pandas is Cython 3 in 2.2.0, so this test fails if that version is installed (which is what we are attempting to upgrade to in Fedora ATM.) |
Remove the Cython "py/ref" avoidance by recording ref entries when unpickling "py/function" entities. Update the unpickler to do record ref entries for "py/function" so that we can remove the hacky self._objs handling for Cython functions in the pickler. Related-to: jsonpickle#460
Cython v3 produces functions that pass the util.is_object() tests. This complicated the unpickler because it needed to start tracking refs for functions, which it never needed to do before. Expand the meaning of is_module_function() so that it includes cython functions and use this check earlier in the pickling process. This makes the pickler handle Cython functions before they ever make it into the "if util.is_object(obj):" code path. These changes restore the pickler's original semantics by ensuring that functions are excluded from the referencing machinery completely. Related-to: jsonpickle#460
* davvid/cython-functions: CHANGES: Pandas and Cython 3.0 compatibility pickler/unpickler: pickle functions and Cython functions earlier pickler/unpickler: record ref entries for functions pickler: flatten Cython functions using _flatten_function() Closes: #460
Thanks for testing! I went ahead and deployed jsonpickle v3.0.3 to pypi with this fix: https://pypi.org/project/jsonpickle/3.0.3/ |
When pandas (tested with 2.0.3) are built against Cython 3.0.0, I'm getting the following test failure:
This is affecting Linux distributions that are building their packages against Cython 3.0.0. To reproduce in a venv:
The text was updated successfully, but these errors were encountered: