Skip to content

Commit

Permalink
from anyvalue for small integers (#3826)
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Jun 27, 2022
1 parent 83161a1 commit 1cc4721
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions polars/polars-core/src/series/any_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,16 @@ impl Series {
None => Ok(Series::full_null(name, av.len(), &DataType::Int32)),
Some(av_) => {
let mut s = match av_ {
#[cfg(feature = "dtype-i8")]
AnyValue::Int8(_) => any_values_to_primitive::<Int8Type>(av).into_series(),
#[cfg(feature = "dtype-i16")]
AnyValue::Int16(_) => any_values_to_primitive::<Int16Type>(av).into_series(),
AnyValue::Int32(_) => any_values_to_primitive::<Int32Type>(av).into_series(),
AnyValue::Int64(_) => any_values_to_primitive::<Int64Type>(av).into_series(),
#[cfg(feature = "dtype-u8")]
AnyValue::UInt8(_) => any_values_to_primitive::<UInt8Type>(av).into_series(),
#[cfg(feature = "dtype-u16")]
AnyValue::UInt16(_) => any_values_to_primitive::<UInt16Type>(av).into_series(),
AnyValue::UInt32(_) => any_values_to_primitive::<UInt32Type>(av).into_series(),
AnyValue::UInt64(_) => any_values_to_primitive::<UInt64Type>(av).into_series(),
AnyValue::Float32(_) => {
Expand Down

0 comments on commit 1cc4721

Please sign in to comment.