Skip to content

Commit c1a4568

Browse files
author
Matthew Katz
committed
fix test and comment
Signed-off-by: Matthew Katz <katz@spiraldb.com>
1 parent 8d3b902 commit c1a4568

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

vortex-array/src/arrays/listview/tests/density.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@ fn overlap_differential_exact_lower_than_estimate() -> VortexResult<()> {
9191
}
9292

9393
#[test]
94-
fn empty_elements_returns_zero() -> VortexResult<()> {
94+
fn empty_elements_returns_one() -> VortexResult<()> {
9595
let mut ctx = test_execution_ctx();
9696
let lv = create_empty_elements_listview();
9797

9898
let exact = lv.compute_density(&mut ctx)?;
9999
let est = lv.estimate_density(&mut ctx)?;
100100

101-
assert!(exact.abs() < EPS);
102-
assert!(est.abs() < EPS);
101+
assert!((exact - 1.0).abs() < EPS);
102+
assert!((est - 1.0).abs() < EPS);
103103
Ok(())
104104
}
105105

vortex-array/src/stats/array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ impl StatsSetRef<'_> {
154154
}
155155

156156
/// Returns the value of `stat` by either fetching it from cache if it exists and is [`Precision::Exact`], or falling back to
157-
/// computation.
157+
/// computation. The underlying compute kernels will cache the computed stat in the latter case.
158158
pub fn compute_stat(&self, stat: Stat, ctx: &mut ExecutionCtx) -> VortexResult<Option<Scalar>> {
159159
// If it's already computed and exact, we can return it.
160160
if let Some(Precision::Exact(s)) = self.get(stat) {

0 commit comments

Comments
 (0)