Skip to content

Commit

Permalink
add more supertypes
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Dec 23, 2021
1 parent fc1c295 commit 3c85adf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions polars/polars-core/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,10 @@ fn _get_supertype(l: &DataType, r: &DataType) -> Option<DataType> {
(UInt32, Float32) => Some(Float32),
(UInt32, Float64) => Some(Float64),
(UInt32, Boolean) => Some(UInt32),
#[cfg(feature = "dtype-date")]
(UInt32, Date) => Some(Int64),
#[cfg(feature = "dtype-datetime")]
(UInt32, Datetime) => Some(Int64),

(UInt64, UInt8) => Some(UInt64),
(UInt64, UInt16) => Some(UInt64),
Expand Down Expand Up @@ -612,6 +616,10 @@ fn _get_supertype(l: &DataType, r: &DataType) -> Option<DataType> {
(Float64, Time) => Some(Float64),
(Float64, Boolean) => Some(Float64),

#[cfg(feature = "dtype-datetime")]
(Date, UInt32) => Some(Int64),
#[cfg(feature = "dtype-datetime")]
(Date, UInt64) => Some(Int64),
#[cfg(feature = "dtype-datetime")]
(Date, Int32) => Some(Int32),
#[cfg(feature = "dtype-datetime")]
Expand All @@ -623,6 +631,10 @@ fn _get_supertype(l: &DataType, r: &DataType) -> Option<DataType> {
#[cfg(feature = "dtype-datetime")]
(Date, Datetime) => Some(Datetime),

#[cfg(feature = "dtype-date")]
(Datetime, UInt32) => Some(Int64),
#[cfg(feature = "dtype-date")]
(Datetime, UInt64) => Some(Int64),
#[cfg(feature = "dtype-date")]
(Datetime, Int32) => Some(Int64),
#[cfg(feature = "dtype-date")]
Expand Down

0 comments on commit 3c85adf

Please sign in to comment.