• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vortex-data / vortex / 16992591828

15 Aug 2025 02:51PM UTC coverage: 87.203% (-0.5%) from 87.72%
16992591828

Pull #2456

github

web-flow
Merge fe7e226a7 into 4a23f65b3
Pull Request #2456: feat: basic BoolBuffer / BoolBufferMut

476 of 1230 new or added lines in 107 files covered. (38.7%)

74 existing lines in 19 files now uncovered.

56525 of 64820 relevant lines covered (87.2%)

623751.88 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.91
/vortex-array/src/arrays/bool/compute/min_max.rs
1
// SPDX-License-Identifier: Apache-2.0
2
// SPDX-FileCopyrightText: Copyright the Vortex contributors
3

4
use std::ops::BitAnd;
5

6
use vortex_error::VortexResult;
7
use vortex_mask::Mask;
8
use vortex_scalar::Scalar;
9

10
use crate::arrays::{BoolArray, BoolVTable};
11
use crate::compute::{MinMaxKernel, MinMaxKernelAdapter, MinMaxResult};
12
use crate::register_kernel;
13

14
impl MinMaxKernel for BoolVTable {
15
    fn min_max(&self, array: &BoolArray) -> VortexResult<Option<MinMaxResult>> {
1,269✔
16
        let x = match array.validity_mask()? {
1,269✔
17
            Mask::AllTrue(_) => array.boolean_buffer().clone(),
1,269✔
18
            Mask::AllFalse(_) => return Ok(None),
×
NEW
19
            Mask::Values(v) => array.boolean_buffer().bitand(v.boolean_buffer()),
×
20
        };
21

22
        // TODO(ngates): we should be able to bail out earlier as soon as we have one true and
23
        //  one false value.
24
        let mut slices = x.set_slices();
1,269✔
25
        // If there are no slices, then all values are false
26
        // if there is a single slice that covers the entire array, then all values are true
27
        // otherwise, we have a mix of true and false values
28

29
        let Some(slice) = slices.next() else {
1,269✔
30
            // all false
31
            return Ok(Some(MinMaxResult {
79✔
32
                min: Scalar::new(array.dtype().clone(), false.into()),
79✔
33
                max: Scalar::new(array.dtype().clone(), false.into()),
79✔
34
            }));
79✔
35
        };
36
        if slice.0 == 0 && slice.1 == x.len() {
1,190✔
37
            // all true
38
            return Ok(Some(MinMaxResult {
317✔
39
                min: Scalar::new(array.dtype().clone(), true.into()),
317✔
40
                max: Scalar::new(array.dtype().clone(), true.into()),
317✔
41
            }));
317✔
42
        };
873✔
43

44
        Ok(Some(MinMaxResult {
873✔
45
            min: Scalar::new(array.dtype().clone(), false.into()),
873✔
46
            max: Scalar::new(array.dtype().clone(), true.into()),
873✔
47
        }))
873✔
48
    }
1,269✔
49
}
50

51
register_kernel!(MinMaxKernelAdapter(BoolVTable).lift());
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc