From 682c1b3baf6ac481000782c4d09017a7eaafb06a Mon Sep 17 00:00:00 2001 From: Stijn de Gooijer Date: Fri, 19 Jan 2024 11:05:47 +0100 Subject: [PATCH] Minor refactor --- crates/polars-ops/src/series/ops/abs.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/crates/polars-ops/src/series/ops/abs.rs b/crates/polars-ops/src/series/ops/abs.rs index 4f945a6f85c29..018f9595f35ca 100644 --- a/crates/polars-ops/src/series/ops/abs.rs +++ b/crates/polars-ops/src/series/ops/abs.rs @@ -19,11 +19,6 @@ pub fn abs(s: &Series) -> PolarsResult { Int16 => abs_numeric(s.i16().unwrap()).into_series(), Int32 => abs_numeric(s.i32().unwrap()).into_series(), Int64 => abs_numeric(s.i64().unwrap()).into_series(), - #[cfg(feature = "dtype-u8")] - UInt8 => s.clone(), - #[cfg(feature = "dtype-u16")] - UInt16 => s.clone(), - UInt32 | UInt64 => s.clone(), Float32 => abs_numeric(s.f32().unwrap()).into_series(), Float64 => abs_numeric(s.f64().unwrap()).into_series(), #[cfg(feature = "dtype-decimal")] @@ -42,6 +37,7 @@ pub fn abs(s: &Series) -> PolarsResult { let out = abs_numeric(ca).into_series(); out.cast(s.dtype())? }, + dt if dt.is_unsigned_integer() => s.clone(), dt => polars_bail!(opq = abs, dt), }; Ok(out)