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

vortex-data / vortex / 17075133033

19 Aug 2025 04:01PM UTC coverage: 87.949% (+0.09%) from 87.856%
17075133033

push

github

web-flow
feat: ArrayOperations infallible, eager validation + new_unchecked (#4177)

ArrayOperations currently return VortexResult<>, but they really should
just be infallible. A failed array op is generally indicative of
programmer or encoding error. There's really nothing interesting we can
do to handle an out-of-bounds slice() or scalar_at.

There's a lot that falls out of this, like fixing a bunch of tests,
tweaking our scalar value casting to return Option instead of Result,
etc.

---------

Signed-off-by: Andrew Duffy <andrew@a10y.dev>

1744 of 1985 new or added lines in 195 files covered. (87.86%)

36 existing lines in 27 files now uncovered.

56745 of 64520 relevant lines covered (87.95%)

624082.56 hits per line

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

0.0
/vortex-array/src/arrays/constant/encode.rs
1
// SPDX-License-Identifier: Apache-2.0
2
// SPDX-FileCopyrightText: Copyright the Vortex contributors
3

4
use vortex_error::VortexResult;
5

6
use crate::Canonical;
7
use crate::arrays::{ConstantArray, ConstantEncoding, ConstantVTable};
8
use crate::vtable::EncodeVTable;
9

10
impl EncodeVTable<ConstantVTable> for ConstantVTable {
11
    fn encode(
×
12
        _encoding: &ConstantEncoding,
×
13
        canonical: &Canonical,
×
14
        _like: Option<&ConstantArray>,
×
15
    ) -> VortexResult<Option<ConstantArray>> {
×
16
        let canonical = canonical.as_ref();
×
17
        if canonical.is_constant() {
×
NEW
18
            let scalar = canonical.scalar_at(0);
×
19
            Ok(Some(ConstantArray::new(scalar, canonical.len())))
×
20
        } else {
21
            Ok(None)
×
22
        }
23
    }
×
24
}
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