dataframerustrust-cargorust-polarsrust-crates

Failed to resolve polars_core, arrow::legacy, Dataframe is polars-lazy = "0.44.2"


Despite the:

  1. reading of the polar_lazy 0.44.2

  2. sucessful installation of cargo add polars-lazy

the following code results in errors:

N.B: Cargo.toml

[dependencies]
arrow = "53.2.0"
polars-lazy = "0.44.2"

Solution

  • It's a little hard to tell, but the "arrow" crate used in the example is a renamed import of polars-arrow, not the arrow crate (see the dependencies in the Cargo.toml):

    [dependencies.arrow]
    default-features = false
    features = ["compute_aggregate", "compute_arithmetics", "compute_bitwise", "compute_boolean", "compute_boolean_kleene", "compute_cast", "compute_comparison"]
    package = "polars-arrow"
    version = "0.44.2"
    

    And it feels a little like stating the obvious, but to use polars_core you'll have to add polars-core to your dependencies.

    So you should remove arrow = "53.2.0" from your dependencies and instead add:

    polars-core = "0.44.2"
    arrow = { version = "0.44.2", package = "polars-arrow" }