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 when performant feature is enabled for polars #98

Closed
lukeshingles opened this issue Aug 15, 2024 · 2 comments · Fixed by #99
Closed

Compilation error when performant feature is enabled for polars #98

lukeshingles opened this issue Aug 15, 2024 · 2 comments · Fixed by #99

Comments

@lukeshingles
Copy link
Contributor

When the "performant" feature of polars is enabled, compiling a project with pyo3-polars 0.16.0 gives the following compilation error with rustc 1.80.1:

   Compiling pyo3-polars v0.16.0
error[E0004]: non-exhaustive patterns: `&DataType::Struct(_)` not covered
   --> /Users/luke/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-polars-0.16.0/src/types.rs:357:15
    |
357 |         match &self.0 {
    |               ^^^^^^^ pattern `&DataType::Struct(_)` not covered
    |
note: `DataType` defined here
   --> /Users/luke/.cargo/registry/src/index.crates.io-6f17d22bba15001f/polars-core-0.42.0/src/datatypes/dtype.rs:44:1
    |
44  | pub enum DataType {
    | ^^^^^^^^^^^^^^^^^
...
92  |     Struct(Vec<Field>),
    |     ------ not covered
    = note: the matched value is of type `&DataType`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
492 ~             },
493 +             &DataType::Struct(_) => todo!()
    |

For more information about this error, try `rustc --explain E0004`.

cargo.toml

[dependencies]
polars = { version = "0.42", features = ["diagonal_concat", "performant"] }
pyo3 = { version = "0.22", features = ["abi3-py310"] }
pyo3-polars = "0.16"
rayon = "1.10"

This error does not occur when pyo3-polars 0.15, polars 0.41, pyo3 0.21 are used, or when the performant feature is removed.

@erichutchins
Copy link

Adding "dtype-struct" feature yields the same error in my plugin project

[dependencies]
pyo3 = { version = "0.22.2", features = ["extension-module", "abi3-py38"] }
pyo3-polars = { version = "0.16.0", features = ["derive"] }
serde = { version = "1", features = ["derive"] }
polars = { version = "0.42.0", features = [
    "dtype-struct",
], default-features = false }

@lukeshingles
Copy link
Contributor Author

Adding "dtype-struct" feature yields the same error in my plugin project

The solution seems to be to add the dtype-struct feature to pyo3-polars, but this currently causes a compilation error. I've fixed that in PR #99.

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