Skip to content

Commit

Permalink
fix(rust): Implement is_nested_null for Null Array (#19219)
Browse files Browse the repository at this point in the history
  • Loading branch information
eitsupi authored Oct 14, 2024
1 parent ff10b38 commit df8699b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/polars-core/src/datatypes/any_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions crates/polars-core/src/datatypes/dtype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit df8699b

Please sign in to comment.