diff --git a/src/InMemoryDatasets.jl b/src/InMemoryDatasets.jl index 9c6a276..69fb69a 100644 --- a/src/InMemoryDatasets.jl +++ b/src/InMemoryDatasets.jl @@ -120,7 +120,8 @@ export update! - +SMALLSIGNED = Union{Int16, Int32, Int8} +SMALLUNSIGNED = Union{UInt16, UInt32, UInt8} include("other/index.jl") diff --git a/src/byrow/row_functions.jl b/src/byrow/row_functions.jl index 9642a81..2d7df23 100644 --- a/src/byrow/row_functions.jl +++ b/src/byrow/row_functions.jl @@ -34,8 +34,8 @@ function row_sum(ds::AbstractDataset, f::Function, cols = names(ds, Union{Missi CT = mapreduce(eltype, promote_type, view(_columns(ds),colsidx)) T = Core.Compiler.return_type(f, Tuple{CT}) CT = our_nonmissingtype(T) - CT <: Base.SmallSigned ? CT = Int : nothing - CT <: Base.SmallUnsigned ? CT = UInt : nothing + CT <: SMALLSIGNED ? CT = Int : nothing + CT <: SMALLUNSIGNED ? CT = UInt : nothing CT <: Bool ? CT = Int : nothing T = Union{Missing, CT} init0 = _missings(T, nrow(ds)) @@ -69,8 +69,8 @@ function row_prod(ds::AbstractDataset, f::Function, cols = names(ds, Union{Missi CT = mapreduce(eltype, promote_type, view(_columns(ds),colsidx)) T = Core.Compiler.return_type(f, Tuple{CT}) CT = our_nonmissingtype(T) - CT <: Base.SmallSigned ? CT = Int : nothing - CT <: Base.SmallUnsigned ? CT = UInt : nothing + CT <: SMALLSIGNED ? CT = Int : nothing + CT <: SMALLUNSIGNED ? CT = UInt : nothing CT <: Bool ? CT = Int : nothing T = Union{Missing, CT} init0 = _missings(T, nrow(ds)) @@ -744,9 +744,9 @@ function row_cumsum!(ds::Dataset, cols = names(ds, Union{Missing, Number}); miss colsidx = index(ds)[cols] T = mapreduce(eltype, promote_type, view(_columns(ds),colsidx)) if T <: Union{Missing, INTEGERS} - T <: Union{Missing, Base.SmallSigned} - T = T <: Union{Missing, Base.SmallSigned, Bool} ? Union{Int, Missing} : T - T = T <: Union{Missing, Base.SmallUnsigned} ? Union{Missing, UInt} : T + T <: Union{Missing, SMALLSIGNED} + T = T <: Union{Missing, SMALLSIGNED, Bool} ? Union{Int, Missing} : T + T = T <: Union{Missing, SMALLUNSIGNED} ? Union{Missing, UInt} : T end for i in colsidx if eltype(ds[!, i]) >: Missing diff --git a/src/sort/gatherby.jl b/src/sort/gatherby.jl index 694ece8..c914b74 100644 --- a/src/sort/gatherby.jl +++ b/src/sort/gatherby.jl @@ -248,8 +248,8 @@ end function gatherby_mapreduce(gds::GatherBy, f, op, col::ColumnIndex, nt, init, ::Val{T}; promotetypes = false, threads = true) where T CT = T if promotetypes - T <: Base.SmallSigned ? CT = Int : nothing - T <: Base.SmallUnsigned ? CT = UInt : nothing + T <: SMALLSIGNED ? CT = Int : nothing + T <: SMALLUNSIGNED ? CT = UInt : nothing end res = allocatecol(Union{CT, Missing}, gds.lastvalid) fill!(res, init) diff --git a/src/stat/hp_stat.jl b/src/stat/hp_stat.jl index c88861c..ed5d6aa 100644 --- a/src/stat/hp_stat.jl +++ b/src/stat/hp_stat.jl @@ -42,8 +42,8 @@ function hp_sum(f, x::AbstractVector{T}) where {T} cz = div(n, nt) cz == 0 && return stat_sum(f, x) CT = Core.Compiler.return_type(f, Tuple{our_nonmissingtype(eltype(x))}) - CT <: Base.SmallSigned ? CT = Int : nothing - CT <: Base.SmallUnsigned ? CT = UInt : nothing + CT <: SMALLSIGNED ? CT = Int : nothing + CT <: SMALLUNSIGNED ? CT = UInt : nothing CT <: Bool ? CT = Int : nothing if T >: Missing CT = Union{Missing,CT}