polars_arrow::compute::boolean_kleene

Function all

Source
pub fn all(array: &BooleanArray) -> Option<bool>
Available on crate feature compute_boolean_kleene only.
Expand description

Returns whether all values in the array are true.

The output is unknown (None) if the array contains any null values and no false values.

ยงExample

use polars_arrow::array::BooleanArray;
use polars_arrow::compute::boolean_kleene::all;

let a = BooleanArray::from(&[Some(true), Some(true)]);
let b = BooleanArray::from(&[Some(false), Some(true)]);
let c = BooleanArray::from(&[None, Some(true)]);

assert_eq!(all(&a), Some(true));
assert_eq!(all(&b), Some(false));
assert_eq!(all(&c), None);