Skip to content

Commit

Permalink
this fixes bugs in 1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
msl committed Jun 18, 2024
1 parent 95b1c01 commit 0f326da
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
3 changes: 2 additions & 1 deletion src/InMemoryDatasets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ export
update!



SMALLSIGNED = Union{Int16, Int32, Int8}
SMALLUNSIGNED = Union{UInt16, UInt32, UInt8}


include("other/index.jl")
Expand Down
14 changes: 7 additions & 7 deletions src/byrow/row_functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/sort/gatherby.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/stat/hp_stat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 0f326da

Please sign in to comment.