You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: take_into mask length must equal _indices_ length (#2396)
I added a test that catches this behavior. In particular, the indices
must differ in length from the array and also it must be either all
valid or all invalid.
I additionally changed `Validity::to_logical` to assert the length
matches the array length. Since mixed validity is more common than the
other two, I hope this new assertion will surface these kinds of issues
in more tests.
An example of a failure on `develop` with these new tests:
```
---- array::primitive::compute::take::test::test_take_into stdout ----
thread 'array::primitive::compute::take::test::test_take_into' panicked at vortex-array/src/builders/primitive.rs:98:9:
assertion `left == right` failed: null count must equal value count
left: 5
right: 3
stack backtrace:
0: rust_begin_unwind
at /rustc/409998c4e8cae45344fd434b358b697cc93870d0/library/std/src/panicking.rs:676:5
1: core::panicking::panic_fmt
at /rustc/409998c4e8cae45344fd434b358b697cc93870d0/library/core/src/panicking.rs:75:14
2: core::panicking::assert_failed_inner
3: core::panicking::assert_failed
at /rustc/409998c4e8cae45344fd434b358b697cc93870d0/library/core/src/panicking.rs:364:5
4: vortex_array::builders::primitive::PrimitiveBuilder<T>::finish_into_primitive
at ./src/builders/primitive.rs:98:9
5: <vortex_array::builders::primitive::PrimitiveBuilder<T> as vortex_array::builders::ArrayBuilder>::finish
at ./src/builders/primitive.rs:176:9
6: vortex_array::array::primitive::compute::take::test::test_take_into
at ./src/array/primitive/compute/take.rs:150:22
7: vortex_array::array::primitive::compute::take::test::test_take_into::{{closure}}
at ./src/array/primitive/compute/take.rs:142:24
```
0 commit comments