Skip to content

Commit

Permalink
Add fast quit for numeric
Browse files Browse the repository at this point in the history
  • Loading branch information
mcrumiller committed Jan 3, 2025
1 parent de6240e commit 18c61be
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/polars-ops/src/series/ops/horizontal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,10 @@ pub fn mean_horizontal(
// All remaining must be numeric (or null).
for col in &columns[first_non_null_idx + 1..] {
let dtype = col.dtype();
if !(dtype.is_numeric()
if !ignore_nulls && dtype == &DataType::Null {
// The presence of a single null column guarantees the output is all-null.
return null_with_supertype(columns, true);
} else if !(dtype.is_numeric()
|| dtype.is_decimal()
|| dtype.is_bool()
|| dtype.is_temporal()
Expand Down

0 comments on commit 18c61be

Please sign in to comment.