Skip to content

Commit

Permalink
Minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Jan 19, 2024
1 parent 0dec514 commit 682c1b3
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions crates/polars-ops/src/series/ops/abs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ pub fn abs(s: &Series) -> PolarsResult<Series> {
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")]
Expand All @@ -42,6 +37,7 @@ pub fn abs(s: &Series) -> PolarsResult<Series> {
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)
Expand Down

0 comments on commit 682c1b3

Please sign in to comment.