-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port PendingRow
to arrow-rs
#8617
Conversation
3b09fb8
to
55df031
Compare
Web viewer built successfully. If applicable, you should also test it:
Note: This comment is updated whenever you push a commit. |
/// * The list only contains null entries, or empty arrays, or a mix of both. | ||
#[inline] | ||
pub fn is_list_array_semantically_empty(list_array: &ListArray) -> bool { | ||
list_array.values().is_empty() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took the freedom to simplify this function quite a bit from the original:
rerun/crates/store/re_chunk/src/util.rs
Lines 22 to 37 in 71215db
pub fn is_list_array_semantically_empty(list_array: &ArrowListArray<i32>) -> bool { | |
let is_physically_empty = || list_array.is_empty(); | |
let is_all_nulls = || { | |
list_array | |
.validity() | |
.map_or(false, |bitmap| bitmap.unset_bits() == list_array.len()) | |
}; | |
let is_all_empties = || list_array.offsets().lengths().all(|len| len == 0); | |
let is_a_mix_of_nulls_and_empties = | |
|| list_array.iter().flatten().all(|array| array.is_empty()); | |
is_physically_empty() || is_all_nulls() || is_all_empties() || is_a_mix_of_nulls_and_empties() | |
} |
Was the old complexity necessary for some reason I don't see, or an oversight?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All I can say is that this logic was very important for the UX of the dataframe views and APIs.
Whether the two implementations are equivalent, I'm tempted to say yes but I might be missing something too.
@@ -0,0 +1,317 @@ | |||
use arrow::{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole file is a port of https://github.com/rerun-io/rerun/blob/main/crates/store/re_chunk
pub fn concat_arrays(arrays: &[&dyn Array]) -> arrow::error::Result<ArrayRef> { | ||
#[allow(clippy::disallowed_methods)] // that's the whole point | ||
arrow::compute::concat(arrays) | ||
// TODO: call .shrink_to_fit on the result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Requires Update arrow, pyo3, and numpy #8618
…but maybe it's fine to regress on this temporarily
@rerun-bot full-check |
Started a full build: https://github.com/rerun-io/rerun/actions/runs/12687112287 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gave it a very shallow look but it all seems fairly mechanical so there shouldn't too many surprises.
A full-check will definitely tell us if something went wrong in any case.
/// * The list only contains null entries, or empty arrays, or a mix of both. | ||
#[inline] | ||
pub fn is_list_array_semantically_empty(list_array: &ListArray) -> bool { | ||
list_array.values().is_empty() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All I can say is that this logic was very important for the UX of the dataframe views and APIs.
Whether the two implementations are equivalent, I'm tempted to say yes but I might be missing something too.
@rerun-bot full-check |
Started a full build: https://github.com/rerun-io/rerun/actions/runs/12687313927 |
Deploying the Python docs failed the first run, but worked the second go |
re_arrow2
toarrow
#3741arrow-rs
re_arrow2#15NOTE: this will regress on memory use, because we lack
.shrink_to_fit
, which will arrive in