From 9d9fb5c078bb6aab8a1db459c8e80764e1095389 Mon Sep 17 00:00:00 2001 From: eitsupi Date: Sun, 13 Oct 2024 15:58:34 +0000 Subject: [PATCH] fix(rust): Implement is_nested_null for Null Array --- crates/polars-core/src/datatypes/any_value.rs | 2 ++ crates/polars-core/src/datatypes/dtype.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/crates/polars-core/src/datatypes/any_value.rs b/crates/polars-core/src/datatypes/any_value.rs index 4155a9bf14e9..edf76969e976 100644 --- a/crates/polars-core/src/datatypes/any_value.rs +++ b/crates/polars-core/src/datatypes/any_value.rs @@ -528,6 +528,8 @@ impl<'a> AnyValue<'a> { match self { AnyValue::Null => true, AnyValue::List(s) => s.null_count() == s.len(), + #[cfg(feature = "dtype-array")] + AnyValue::Array(s, _) => s.null_count() == s.len(), #[cfg(feature = "dtype-struct")] AnyValue::Struct(_, _, _) => self._iter_struct_av().all(|av| av.is_nested_null()), _ => false, diff --git a/crates/polars-core/src/datatypes/dtype.rs b/crates/polars-core/src/datatypes/dtype.rs index cd79349bfcd8..e18dd9026a4d 100644 --- a/crates/polars-core/src/datatypes/dtype.rs +++ b/crates/polars-core/src/datatypes/dtype.rs @@ -648,6 +648,8 @@ impl DataType { match self { Null => true, List(field) => field.is_nested_null(), + #[cfg(feature = "dtype-array")] + Array(field, _) => field.is_nested_null(), #[cfg(feature = "dtype-struct")] Struct(fields) => fields.iter().all(|fld| fld.dtype.is_nested_null()), _ => false,