Skip to content

Commit

Permalink
chore: sync with append & extend
Browse files Browse the repository at this point in the history
use direct type to avoid extra AsRef type check
  • Loading branch information
flisky committed Jan 25, 2024
1 parent f7bcad4 commit c040e62
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion crates/polars-core/src/series/implementations/decimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ impl SeriesTrait for SeriesWrap<DecimalChunked> {

fn extend(&mut self, other: &Series) -> PolarsResult<()> {
polars_ensure!(self.0.dtype() == other.dtype(), extend);
self.0.extend(other.as_ref().as_ref());
let other = other.decimal()?;
self.0.extend(&other.0);
Ok(())
}

Expand Down
2 changes: 1 addition & 1 deletion crates/polars-core/src/series/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ mod test {

{
let mut s2 = s2.clone();
s2.append(&s1).unwrap();
s2.extend(&s1).unwrap();
#[cfg(feature = "python")]
assert_eq!(s2.get(2).unwrap(), AnyValue::Float64(2.29)); // 2.3 == 2.2999999999999998
#[cfg(not(feature = "python"))]
Expand Down

0 comments on commit c040e62

Please sign in to comment.