-
Notifications
You must be signed in to change notification settings - Fork 784
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
Add doc example for creating FixedSizeListArray
#1426
Add doc example for creating FixedSizeListArray
#1426
Conversation
Signed-off-by: remzi <[email protected]>
arrow/src/array/array_list.rs
Outdated
/// .add_buffer(Buffer::from_slice_ref(&[0, 1, 2, 3, 4, 5, 6, 7, 8])) | ||
/// .build() | ||
/// .unwrap(); | ||
//// // Construct a list array from the above two |
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.
Extra space
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.
Done.
BTW, I found that some examples include many assert_check. Just there is a question for me, is it necessary to include many checks in the example? |
arrow/src/array/array_list.rs
Outdated
/// .add_buffer(Buffer::from_slice_ref(&[0, 1, 2, 3, 4, 5, 6, 7, 8])) | ||
/// .build() | ||
/// .unwrap(); | ||
//// // Construct a list array from the above two |
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.
"from above two"?
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.
delete the comment.
Actually, I copied the comment from https://github.com/apache/arrow-rs/blob/master/arrow/src/array/array_list.rs#L692
@@ -342,6 +342,46 @@ pub type LargeListArray = GenericListArray<i64>; | |||
|
|||
/// A list array where each element is a fixed-size sequence of values with the same | |||
/// type whose maximum length is represented by a i32. | |||
/// # Example |
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.
nit: can we add a blank line before?
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.
Done
arrow/src/array/array_list.rs
Outdated
/// assert_eq!(0, list_array.null_count()); | ||
/// assert_eq!(6, list_array.value_offset(2)); | ||
/// assert_eq!(3, list_array.value_length()); | ||
/// assert_eq!( |
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.
maybe it's clearer to compare whole array content here, for instance, checking list_array.value(1)
is [0, 1, 2]
, list_array.value(2)
is [3, 4, 5]
, etc.
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.
Done!
Signed-off-by: remzi <[email protected]>
Signed-off-by: remzi <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #1426 +/- ##
==========================================
- Coverage 83.17% 82.68% -0.50%
==========================================
Files 182 185 +3
Lines 53439 53822 +383
==========================================
+ Hits 44449 44502 +53
- Misses 8990 9320 +330
Continue to review full report at Codecov.
|
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.
LGTM
Merged, thanks! |
Signed-off-by: remzi [email protected]
Which issue does this PR close?
Closes #1392.