Skip to content

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

Open
@qqlearn123

Description

@qqlearn123

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions