You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/09/09 20:21:53 UTC
[GitHub] [arrow-rs] alamb commented on a change in pull request #745: fix: Support length on slices with null
alamb commented on a change in pull request #745:
URL: https://github.com/apache/arrow-rs/pull/745#discussion_r705669376
##########
File path: arrow/src/compute/kernels/length.rs
##########
@@ -243,18 +242,13 @@ mod tests {
/// Tests with an offset
#[test]
fn length_offsets() -> Result<()> {
- let a = StringArray::from(vec!["hello", " ", "world"]);
- let b = make_array(
- ArrayData::builder(DataType::Utf8)
- .len(2)
- .offset(1)
- .buffers(a.data_ref().buffers().to_vec())
- .build(),
- );
- let result = length(b.as_ref())?;
-
- let expected = Int32Array::from(vec![1, 5]);
- assert_eq!(expected.data(), result.data());
+ let a = StringArray::from(vec![Some("hello"), Some(" "), Some("world"), None]);
+ let b = a.slice(1, 3);
+ let result = bit_length(b.as_ref())?;
Review comment:
good eyes. I agree that the intent of this test is to test `length` and thus it should not be calling `bit_length`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org