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
| @property | ||
| def nbytes(self) -> int: ... | ||
| def copy(self): ... | ||
| def copy(self, order: str = "C"): ... |
There was a problem hiding this comment.
any reason this is "C" instead of ...?
There was a problem hiding this comment.
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.
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.
| return (Period, object_state) | ||
|
|
||
| def strftime(self, fmt: str) -> str: | ||
| def strftime(self, fmt: str | None) -> str: |
|
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.rstfile if fixing a bug or adding a new feature.