Function all

Source
pub fn all(array: &BooleanArray) -> Option<bool>
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);