Error when enabling “Lazy” option in Polars/Rust

I’m trying to read a csv file and add a row filter. But I’m getting error when compiling with “Lazy” option on Polars. What am I doing wrong?

The toml file is:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>[package]
name = "test"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
#Error:
#polars = { git = "https://github.com/pola-rs/polars",features = ["lazy"] }
#Works:
polars = { git = "https://github.com/pola-rs/polars" }
#Error:
#polars = { version = "0.40.0", features = ["csv-file","lazy"] }
#Works
#polars = "0.40.0"
</code>
<code>[package] name = "test" version = "0.1.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] #Error: #polars = { git = "https://github.com/pola-rs/polars",features = ["lazy"] } #Works: polars = { git = "https://github.com/pola-rs/polars" } #Error: #polars = { version = "0.40.0", features = ["csv-file","lazy"] } #Works #polars = "0.40.0" </code>
[package]
name = "test"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
#Error:
#polars = { git = "https://github.com/pola-rs/polars",features = ["lazy"] }
#Works:
polars = { git = "https://github.com/pola-rs/polars" }
#Error:
#polars = { version = "0.40.0", features = ["csv-file","lazy"] }
#Works
#polars = "0.40.0"

The error is:
For

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>polars = { git = "https://github.com/pola-rs/polars",features = ["lazy"] }
</code>
<code>polars = { git = "https://github.com/pola-rs/polars",features = ["lazy"] } </code>
polars = { git = "https://github.com/pola-rs/polars",features = ["lazy"] }

I got

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>error[E0412]: cannot find type `CloudOptions` in this scope
</code>
<code>error[E0412]: cannot find type `CloudOptions` in this scope </code>
error[E0412]: cannot find type `CloudOptions` in this scope

For

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>polars = { version = "0.40.0", features = ["csv-file","lazy"] }
</code>
<code>polars = { version = "0.40.0", features = ["csv-file","lazy"] } </code>
polars = { version = "0.40.0", features = ["csv-file","lazy"] }

I got

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>error: failed to select a version for `polars`.
... required by package `dicionario_tm v0.1.0`
versions that meet the requirements `^0.40.0` are: 0.40.0
the package `test` depends on `polars`, with features: `csv-file` but `polars` does not have these features.
</code>
<code>error: failed to select a version for `polars`. ... required by package `dicionario_tm v0.1.0` versions that meet the requirements `^0.40.0` are: 0.40.0 the package `test` depends on `polars`, with features: `csv-file` but `polars` does not have these features. </code>
error: failed to select a version for `polars`.
    ... required by package `dicionario_tm v0.1.0`
versions that meet the requirements `^0.40.0` are: 0.40.0

the package `test` depends on `polars`, with features: `csv-file` but `polars` does not have these features.

What I’m trying to run:
(the idea of the following code is to read two csv files, join them and then filter some rows by a collumn id)

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>use polars::prelude::*;
fn read_csv(filename:&str) -> DataFrame {
let parse_options = CsvParseOptions::default()
.with_separator(b';');
let reader = CsvReadOptions::default()
.with_has_header(true)
.with_parse_options(parse_options)
.try_into_reader_with_file_path(Some(filename.into()))
.unwrap();
reader.finish().unwrap()
}
fn main() {
let df1 = read_csv("file1.csv");
let df2 = read_csv("file2.csv");
let mut df3 = df1.join(&df2,
["ID"],
["ID"] ,
JoinArgs::new(JoinType::Inner))
.unwrap()
.select(["ID", "AA", "BB", "CC"])
.unwrap()
;
df3 = df3.filter(
col("ID").eq(lit(1))
).collect();
println!("{:?}", df3);
}
</code>
<code>use polars::prelude::*; fn read_csv(filename:&str) -> DataFrame { let parse_options = CsvParseOptions::default() .with_separator(b';'); let reader = CsvReadOptions::default() .with_has_header(true) .with_parse_options(parse_options) .try_into_reader_with_file_path(Some(filename.into())) .unwrap(); reader.finish().unwrap() } fn main() { let df1 = read_csv("file1.csv"); let df2 = read_csv("file2.csv"); let mut df3 = df1.join(&df2, ["ID"], ["ID"] , JoinArgs::new(JoinType::Inner)) .unwrap() .select(["ID", "AA", "BB", "CC"]) .unwrap() ; df3 = df3.filter( col("ID").eq(lit(1)) ).collect(); println!("{:?}", df3); } </code>
use polars::prelude::*;


fn read_csv(filename:&str) -> DataFrame {
    let parse_options = CsvParseOptions::default()
    .with_separator(b';');

    let reader = CsvReadOptions::default()
    .with_has_header(true)
    .with_parse_options(parse_options)
    .try_into_reader_with_file_path(Some(filename.into()))
    .unwrap();

    reader.finish().unwrap()
}

fn main() {

    let df1 = read_csv("file1.csv");
    let df2 = read_csv("file2.csv");

    let mut df3 = df1.join(&df2,
         ["ID"], 
         ["ID"] , 
         JoinArgs::new(JoinType::Inner))
         .unwrap()
         .select(["ID", "AA", "BB", "CC"])
         .unwrap()
         ;
    
    df3 = df3.filter(
        col("ID").eq(lit(1))
    ).collect();

    
     println!("{:?}", df3);
}

I believe that I got the latest version of rust:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>$ rustup -V
rustup 1.27.1 (54dd3d00f 2024-04-24)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.78.0 (9b00956e5 2024-04-29)
</code>
<code>$ rustup -V rustup 1.27.1 (54dd3d00f 2024-04-24) info: This is the version for the rustup toolchain manager, not the rustc compiler. info: The currently active `rustc` version is `rustc 1.78.0 (9b00956e5 2024-04-29) </code>
$ rustup -V
rustup 1.27.1 (54dd3d00f 2024-04-24)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.78.0 (9b00956e5 2024-04-29)

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật