Skip to content

Commit

Permalink
fix(rust): LazyFrame.drop_columns overflow issue when columns.len()>s…
Browse files Browse the repository at this point in the history
…chema.len() (pola-rs#11716)
  • Loading branch information
rancomp authored Oct 14, 2023
1 parent 0e0daa9 commit 55c9f8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/polars-plan/src/logical_plan/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ impl LogicalPlanBuilder {
pub fn drop_columns(self, to_drop: PlHashSet<String>) -> Self {
let schema = try_delayed!(self.0.schema(), &self.0, into);

let mut output_schema = Schema::with_capacity(schema.len() - to_drop.len());
let mut output_schema = Schema::with_capacity(schema.len().saturating_sub(to_drop.len()));
let columns = schema
.iter()
.filter_map(|(col_name, dtype)| {
Expand Down

0 comments on commit 55c9f8f

Please sign in to comment.