Skip to content

Commit

Permalink
fixes decompress_impl for csv with n_rows set (#17118)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mottl authored Jun 22, 2024
1 parent 7f5412a commit 3af8115
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/polars-io/src/csv/read/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ fn decompress_impl<R: Read>(
},
};
}
if line_count == n_rows {
out.truncate(buf_pos); // retain only first n_rows in out
}
out
},
})
Expand Down

0 comments on commit 3af8115

Please sign in to comment.