Skip to content

Commit

Permalink
fix slice
Browse files Browse the repository at this point in the history
  • Loading branch information
coastalwhite committed Oct 8, 2024
1 parent c9abf96 commit 1d41bde
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/polars-core/src/frame/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@ impl DataFrame {
.filter(|l| *l != 1)
.max()
.unwrap_or(1);

dbg!(broadcast_len);

for col in &mut columns {
// Length not equal to the broadcast len, needs broadcast or is an error.
Expand All @@ -343,8 +345,12 @@ impl DataFrame {
}
}

dbg!(&columns);

let length = if columns.is_empty() { 0 } else { broadcast_len };

dbg!(length);

Ok(unsafe { DataFrame::new_no_checks(length, columns) })
}

Expand Down Expand Up @@ -2479,6 +2485,7 @@ impl DataFrame {
let height = if let Some(fst) = col.first() {
fst.len()
} else {
let (_, length) = slice_offsets(offset, length, self.height());
length
};

Expand Down

0 comments on commit 1d41bde

Please sign in to comment.