-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
Cython 3.0 Checklist #34213
Comments
We know that pandas doesn't work with Cython 3.0 (pandas-dev#34213, pandas-dev#34014) This sets the maximum supported version of Cython in our pyproject.toml to ensure that pandas 1.1.0 can continue to be built from source without Cython pre-installed after Cython 3.0 is released.
@jbrockmendelor @WillAyd Could any of you post an update of the current the status of the cython 3.0 support? I'd like to work on this but would like to avoid running into duplicated work. Also, which language level of cython are we currently on (2 or 3, or 3str)? |
nothing really to do at the moment; we'll revisit once cython 3.0 is released
exclusively 3 |
Thanks for the heads up. So there will be no replication of work. Just discovered an additional problem to the current list: in reduction.pyx, we are mutating the .data member of ndarray. This operation is no longer supported in cython 3.0 and also deprecated in numpy. |
Yah that one is pretty ugly. Three approaches have been discussed:
If you have another idea, or can make options 1 or 2 work, that'd be great. |
Thanks. I have a PR along the lines of 1: The approach is more like find a supported Cython way to use the deprecated numpy API till we decide on 2 or 3. After this PR there is a segment fault from an apparently infinite recursive looking up of a typeslot inside the tslib. @jbrockmendel: any pointers as of where to look at on the pandas side? @da-woods, @scoder: any pointers on the cython side? Here is a piece of the stacktrace:
|
I don't quite see why it's looking forever now (it's possibly a bug...) but I think that's the relevant change and hopefully Not hugely confident of this diagnosis though... |
Neat! We'll be able to get rid of a few non-pythonic code paths in Timestamp, Timedelta, Period, NaT. |
Adding c_api_binop_methods=True fixed all segfaults. |
I believe it's a bug cython/cython#4172. It sounds like you can work around it for now though |
@lithomas1 can you check off the relevant boxes in the OP and possibly close? |
@rhshadrach @lithomas1 is this closable? |
Haven't been up to date on this issue, |
|
@QuLogic - there are unchecked items in the OP here. At a glance, it isn't clear to me what has been done and what remains. If we can confirm all tasks have been done, then yes, this can be closed. |
Collecting TODOs for once we bump to cython3:
searchsorted
usages to use fixed cython version_libs.internals
usefrom cpython.pyport cimport PY_SSIZE_T_MAX
instead ofcdef extern ...
_libs.util
usefrom numpy cimport PyArray_CLEARFLAGS, NPY_ARRAY_C_CONTIGUOUS, NPY_ARRAY_F_CONTIGUOUS
instead ofcdef extern ...
_libs.parsers
usefrom cpython.unicode cimport PyUnicode_FromString
instead ofcdef extern ...
tslibs.parsing
replacePyObject_Str
withstr
(xref Optimize builtin str calls cython/cython#3478)from numpy cimport NPY_DATETIMEUNIT
arg : datetime
annotations in tslibs. Can interfere with non-nano usages ofTimestamp
(xref DEBUG: CY3 test_add_out_of_pydatetime_range #54169)@WillAyd am i missing anything (const object[:]?)? If so, go ahead and edit the OP.
The text was updated successfully, but these errors were encountered: