-
Notifications
You must be signed in to change notification settings - Fork 32
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
Array Length #445
Array Length #445
Conversation
} | ||
|
||
#[inline] | ||
pub fn chunk(&self, idx: usize) -> Option<Array> { | ||
let chunk_start = usize::try_from(&scalar_at(&self.chunk_ends(), idx).unwrap()).unwrap(); |
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.
There's a method on primitive array to get the scalar value out. Since we construct the ends array ourselves it should be safe to use it
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.
Not if it's been compressed
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.
hmm, ok, forgot this can be read
@@ -65,11 +76,12 @@ impl ArrayData { | |||
self.buffer | |||
} | |||
|
|||
pub fn child(&self, index: usize, dtype: &DType) -> Option<&Array> { | |||
pub fn child(&self, index: usize, dtype: &DType, len: usize) -> Option<&Array> { |
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.
both this and the dtype check feel potentially unnecessary, or at least maybe could be debug assertions?
No description provided.