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

Compilation error with pyo3 - gil-refs feature turned on #109

Open
qqlearn123 opened this issue Sep 15, 2024 · 2 comments
Open

Compilation error with pyo3 - gil-refs feature turned on #109

qqlearn123 opened this issue Sep 15, 2024 · 2 comments

Comments

@qqlearn123
Copy link

qqlearn123 commented Sep 15, 2024

Error message encountered:

   Compiling pyo3-polars v0.17.0
error[E0277]: the trait bound `error::ColumnNotFound: HasPyGilRef` is not satisfied
  --> /users/guest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-polars-0.17.0/src/error.rs:63:1
   |
63 | create_exception!(exceptions, ColumnNotFound, PyException);
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `pyo3::PyNativeType` is not implemented for `error::ColumnNotFound`, which is required by `error::ColumnNotFound: HasPyGilRef`
   |
   = help: the following other types implement trait `pyo3::PyNativeType`:
             CancelledError
             IncompleteReadError
             InvalidStateError
             LimitOverrunError
             PanicException
             PyArithmeticError
             PyAssertionError
             PyAttributeError
           and 101 others
   = note: required for `error::ColumnNotFound` to implement `HasPyGilRef`
note: required by a bound in `PyTypeInfo`
  --> /users/guest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-0.22.2/src/type_object.rs:62:38
   |
62 | pub unsafe trait PyTypeInfo: Sized + HasPyGilRef {
   |                                      ^^^^^^^^^^^ required by this bound in `PyTypeInfo`
   = note: this error originates in the macro `$crate::create_exception_type_object` which comes from the expansion of the macro `create_exception` (in Nightly builds, run with -Z macro-backtrace for more info)

Cargo.toml

polars = { version = "0.43", features = ["dtype-struct", "performant"] }
pyo3 = { version = "0.22", features = ["abi3-py38", "extension-module", "gil-refs", "multiple-pymethods"] }
pyo3-polars = { version = "0.17", features = ["derive", "dtype-struct"] }

There are also some other errors along the same line as the one showed above, so I choose to not to include them all here.

Not sure whether pyo3-polars is incompatible with pyo3's gil-refs feature or my setup is somehow incorrect.

@ritchie46
Copy link
Member

Don't turn it on? I don't see why we need to support feature flags we don't use ourselves.

@qqlearn123
Copy link
Author

qqlearn123 commented Sep 16, 2024

But another dependency needs this feature to be turned on. Curious why a pyo3 feature turned on can break pyo3-polars code?

Is it more of a design issue of pyo3?

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

No branches or pull requests

2 participants