-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Upgrade PyO3 to 0.21 and switch to new API #15215
Comments
This is something I can help work on. |
Yes we will definitely upgrade to the new PyO3 version when it's released. I had planned to work on that myself but if it's something you're interested in working on I think it's fine if you want to do the honors here. |
&'py PyAny
and friends
0.21.1 is out, so I will start on this either this week or next. |
PyO3 has support for the Python However, this was never available under the So we have a bunch of workarounds in place to materialize/read ...that are called from Rust, for example here: polars/py-polars/src/conversion/any_value.rs Lines 61 to 64 in 8ef2e21
The 0.21 release notes mention:
So I am expecting that we can now take advantage of native PyO3 datetime support. And I expect a good performance boost + code cleanup to come from this. |
I'm gonna say this is done, insofar as it covers the main Polars repository, and the pyo3-polars issue is already filed for that repository. |
Thanks a lot for the thorough work @itamarst ! |
Description
In PyO3 0.21,
&'py PyAny
will be replaced byBound<'py, PyAny>
. The benefits for upgrading are increased performance, the costs of not upgrading are that the old API is deprecated and will, eventually, go away: https://polar.sh/davidhewitt/posts/replacing-pyo3-api-pt1https://pyo3.rs/latest/migration documents the upgrade process (at time of writing 0.21 is still beta, but will presumably be released soon). Based on their suggestions, I think this would look like this for Polars:
gil-refs
feature, fix other migration issues.Bound
. The development process would involve disablinggil-refs
temporarily, locally only, to spot APIs that need migration, but given this would probably be a series of PRs, the feature should continue to be on inmain
.gil-refs
.pyo3
crate #15669Followups include:
The text was updated successfully, but these errors were encountered: