Skip to content

Commit

Permalink
only whn offset is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Aug 25, 2023
1 parent 850a14a commit 23ee934
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions crates/polars-lazy/src/tests/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ fn test_csv_globbing() -> PolarsResult<()> {
let df = lf.clone().collect()?;
assert_eq!(df.shape(), (100, 4));
let df = LazyCsvReader::new(glob).finish()?.slice(20, 60).collect()?;
dbg!(&full_df, &df);
assert!(full_df.slice(20, 60).frame_equal(&df));

let mut expr_arena = Arena::with_capacity(16);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,12 @@ impl SlicePushDown {
}
(Union {mut inputs, mut options }, Some(state)) => {
options.slice = Some((state.offset, state.len as usize));
for input in &mut inputs {
let input_lp = lp_arena.take(*input);
let input_lp = self.pushdown(input_lp, Some(state), lp_arena, expr_arena)?;
lp_arena.replace(*input, input_lp);
if state.offset == 0 {
for input in &mut inputs {
let input_lp = lp_arena.take(*input);
let input_lp = self.pushdown(input_lp, Some(state), lp_arena, expr_arena)?;
lp_arena.replace(*input, input_lp);
}
}
Ok(Union {inputs, options})
},
Expand Down

0 comments on commit 23ee934

Please sign in to comment.