Repository navigation
Panic on out-of-bounds take and Interleave indices - #10949
connortsui20 wants to merge 2 commits into
Conversation
`Interleave` cannot be serialized, so its selectors always come from code in the same process. A selector that names a missing value or row is a bug in that code, not bad input. The bool and fixed-width kernels now panic on it, which matches `Interleave::scalar_at` and the fixed-width take kernel that `Dict` execution uses. Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
The fixed-width take kernel already panics on an index past the end of the array. `RunEnd` and `Chunked` take returned an error instead, so the result of a bad index depended on the encoding of the array. Both now panic with the message of the fixed-width kernel. Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
|
Closing for now. It is not decided whether an out-of-bounds take index must panic or return an error. The branch |
Merging this PR will degrade performance by 16.32%3 warnings
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
Summary
An out-of-bounds take index panicked or returned an error depending on the encoding. Fixed-width take (and so
Dictexecution) panics, whileRunEndtake,Chunkedtake andInterleaveexecution returned an error. An index past the end is a contract violation by the caller, not invalid input, so all of them now panic.Changes
Interleavecannot be serialized, so its selectors always come from code in the same process. Its bool and fixed-width kernels now panic on a selector that names a missing value or row, which also matchesInterleave::scalar_at.RunEndandChunkedtake panic with the same message as the fixed-width kernel.Take indices can still come from a file, for example the codes of a dict layout. A corrupt file with an out-of-bounds code now panics for
RunEndandChunkedvalues, as it already does for primitive values.Follow-up:
FixedSizeList,NullandFiltertake, and the fixed-width take of aPiecewiseSequence, still return an error.API Changes
takeon aRunEndorChunkedarray, and execution of anInterleavearray, panic on an out-of-bounds index where they used to return an error.