From 9fc4d5fdbb7cd26d9254d46a44b8d8b4a09b5c08 Mon Sep 17 00:00:00 2001 From: Itamar Turner-Trauring Date: Wed, 15 Jan 2025 12:25:01 -0500 Subject: [PATCH] More explanations --- .../polars-ops/src/chunked_array/list/index_of_in.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/polars-ops/src/chunked_array/list/index_of_in.rs b/crates/polars-ops/src/chunked_array/list/index_of_in.rs index a51e7764ed94..55b4e447c04f 100644 --- a/crates/polars-ops/src/chunked_array/list/index_of_in.rs +++ b/crates/polars-ops/src/chunked_array/list/index_of_in.rs @@ -16,9 +16,10 @@ pub fn list_index_of_in(ca: &ListChunked, needles: &Series) -> PolarsResult instead of a Scalar + // which implies AnyValue<'static>? index_of(subseries.as_ref(), needle.clone()) .unwrap() .map(|v| v.try_into().unwrap()), @@ -29,13 +30,17 @@ pub fn list_index_of_in(ca: &ListChunked, needles: &Series) -> PolarsResult builder.append_null(), (Some(subseries), needle) => { let needle = Scalar::new(needles.dtype().clone(), needle.into_static()); - // TODO justify why unwrap()s are ok builder.append_option( index_of(subseries.as_ref(), needle) .unwrap()