pola-rs / pyo3-polars

Plugins/extension for Polars
MIT License
242 stars 40 forks source link

Fix compilation errors for features: dtype-struct and dtype-full #99

Closed lukeshingles closed 1 month ago

lukeshingles commented 1 month ago

When compiling with dtype-struct feature:

   Compiling pyo3-polars v0.16.0 (/Users/luke/GitHub/pyo3-polars/pyo3-polars)
error[E0433]: failed to resolve: use of undeclared type `PyList`
   --> /Users/luke/GitHub/pyo3-polars/pyo3-polars/src/types.rs:475:30
    |
475 |                 let fields = PyList::new_bound(py, iter);
    |                              ^^^^^^ use of undeclared type `PyList`
    |
help: a struct with a similar name exists
    |
475 |                 let fields = PyDict::new_bound(py, iter);
    |                              ~~~~~~
help: consider importing this struct
    |
1   + use pyo3::types::PyList;
    |

For more information about this error, try `rustc --explain E0433`.
error: could not compile `pyo3-polars` (lib) due to 1 previous error

When compiling with the dtype-full feature:

   Compiling pyo3-polars v0.16.0 (/Users/luke/GitHub/pyo3-polars/pyo3-polars)
warning: unused import: `pyo3::types::PyList`
  --> /Users/luke/GitHub/pyo3-polars/pyo3-polars/src/types.rs:23:5
   |
23 | use pyo3::types::PyList;
   |     ^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

error[E0277]: the trait bound `PySeries: From<polars::prelude::Series>` is not satisfied

This PR fixes these compilation errors and the dtype-struct feature is now implied by dtype-full. The dtype-struct feature is needed to resolve #98 when the performant feature is enabled for polars.