-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DEPS: Bump cython 3.0 #54335
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
DEPS: Bump cython 3.0 #54335
Conversation
Looks pretty good. Are all of these changes required to make Cython 3.0 work or are some of the signature changes general cleanups that made sense to bundle? @Dr-Irv FYI in case this impacts pandas-stubs |
Yeah, it turns out our stubs are horrendously outdated. I guess Cython 3.0 exposes the annotation information, so stubtest is complaining now. |
We're not that good in keeping the PYI files in the pandas source and the PYI files in One of the issues here is that the pandas source has things in its PYI files for "private" methods - i.e., methods and classes that are not documented but are used to type check the pandas source. The philosophy on pandas-stubs is to only provide stubs for documented methods and classes - although we may be missing some documented methods/classes that should be in the pandas-stubs, and there are also ones that are in pandas-stubs that are not documented. Cleaning that up is a long term goal. |
Do we really want to include this bump in the 2.1.0 release? AFAIK Apache Arrow will adapt Cython 3.0.0 in their 14.0.0, but they do not release 13.0.0 yet, meaning the integration with Apache Arrow will not work, right? |
We don't compile against Apache Arrow (only numpy). All integration with arrow is done through Python IIRC. |
pandas/_libs/arrays.pyi
Outdated
@@ -26,7 +26,7 @@ class NDArrayBacked: | |||
def size(self) -> int: ... | |||
@property | |||
def nbytes(self) -> int: ... | |||
def copy(self): ... | |||
def copy(self, order: str = "C"): ... |
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.
any reason this is "C"
instead of ...
?
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.
default is "C" and I figured I'd be explicit. I think the ...
is when you can't figure out the default or it's annoying to type?
cc @MarcoGorelli and @Dr-Irv for best practices
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.
In a PYI file, you don't specify default values. Defaults would only go in the declaration of the function. So it should be order: str = ...
. That means the order
argument is optional.
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.
Nice!
@@ -2511,7 +2511,7 @@ cdef class _Period(PeriodMixin): | |||
object_state = None, self.freq, self.ordinal | |||
return (Period, object_state) | |||
|
|||
def strftime(self, fmt: str) -> str: | |||
def strftime(self, fmt: str | None) -> str: |
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.
good one 👍
Nice thanks @lithomas1 |
very cool to see this in! |
This reverts commit 4cf63ea.
* Revert "CLN: Cython 3 cleanups (pandas-dev#54482)" This reverts commit a936863. * Revert "DEPS: Bump cython 3.0 (pandas-dev#54335)" This reverts commit 4cf63ea.
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.