Skip to content
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

Deprecate Python:acquire_gil and use Python::with_gil. #4478

Closed
ghuls opened this issue Aug 18, 2022 · 3 comments · Fixed by #4481
Closed

Deprecate Python:acquire_gil and use Python::with_gil. #4478

ghuls opened this issue Aug 18, 2022 · 3 comments · Fixed by #4481
Assignees

Comments

@ghuls
Copy link
Collaborator

ghuls commented Aug 18, 2022

Problem Description

Deprecate Python:acquire_gil and use Python::with_gil instead as PyO3 recommends this now:

PyO3/pyo3#2549

@ghuls ghuls added the feature label Aug 18, 2022
@ghuls
Copy link
Collaborator Author

ghuls commented Aug 18, 2022

Working on it.

@ritchie46
Copy link
Member

Awesome. I recall that we could not make all work without Python::acquire_gil when I tried that earlier. I wonder what the recommended approach for those cases is.

Let's first find out on which snippets that is the case, then we can ask a more useful question.

@ghuls
Copy link
Collaborator Author

ghuls commented Aug 18, 2022

The only issue I found is in pub fn get_mmap_bytes_reader<'a>(py_f: &'a PyAny) -> PyResult<Box<dyn MmapBytesReader + 'a>> { as it returns multiple types.

ghuls added a commit to ghuls/polars that referenced this issue Aug 18, 2022
…ola-rs#4478)

Deprecate Python:acquire_gil and use Python::with_gil as this
is recommended now by PyO3.
Only get_mmap_bytes_reader function is still using Python:acquire_gil
as it has incompatible return types.

Closes: pola-rs#4478
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants