Skip to content

Commit ceabab5

Browse files
committed
fixes
1 parent 55dddd1 commit ceabab5

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

encodings/runend/src/compute/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ pub(crate) mod filter;
55
mod invert;
66
mod is_sorted;
77
mod min_max;
8+
mod nan_count;
89
mod scalar_at;
910
mod slice;
1011
pub(crate) mod take;
1112
mod take_from;
12-
mod nan_count;
1313

1414
use vortex_array::Array;
1515
use vortex_array::compute::{
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

vortex-array/src/compute/nan_count.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,19 @@ pub fn nan_count(array: &dyn Array) -> VortexResult<Option<usize>> {
3030
return Ok(None);
3131
}
3232

33-
// Only float arrays can have NaNs
34-
if !array.dtype().is_float() {
35-
return Ok(Some(0));
36-
}
37-
3833
let nan_count = array
3934
.statistics()
4035
.get_as::<usize>(Stat::NaNCount)
4136
.and_then(Precision::as_exact);
37+
4238
if let Some(nan_count) = nan_count {
4339
return Ok(Some(nan_count));
4440
}
4541

46-
let nan_count = if let Some(fn_) = array.vtable().nan_count_fn() {
42+
// Only float arrays can have NaNs
43+
let nan_count = if !array.dtype().is_float() {
44+
Some(0)
45+
} else if let Some(fn_) = array.vtable().nan_count_fn() {
4746
fn_.nan_count(array)?
4847
} else {
4948
let canonical = array.to_canonical()?;

0 commit comments

Comments
 (0)