Skip to content

Commit

Permalink
c
Browse files Browse the repository at this point in the history
  • Loading branch information
nameexhaustion committed Nov 7, 2024
1 parent ba1175e commit 7e5705e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions crates/polars-arrow/src/legacy/kernels/fixed_size_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ pub fn sub_fixed_size_list_get_literal(
usize::try_from(index).unwrap()
};

let index_is_oob = index >= width;

if !null_on_oob && index >= width {
polars_bail!(
ComputeError:
Expand All @@ -40,11 +42,16 @@ pub fn sub_fixed_size_list_get_literal(

let values = arr.values();

let mut growable = make_growable(&[values.as_ref()], values.validity().is_some(), arr.len());
let mut growable = make_growable(
&[values.as_ref()],
values.validity().is_some() | arr.validity().is_some() | index_is_oob,
arr.len(),
);

if index >= width {
if index_is_oob {
unsafe { growable.extend_validity(arr.len()) }
return Ok(growable.as_box());
let out = growable.as_box();
return Ok(out);
}

if let Some(arr_validity) = arr.validity() {
Expand Down

0 comments on commit 7e5705e

Please sign in to comment.