JuliaData / CategoricalArrays.jl

Arrays for working with categorical data (both nominal and ordinal)
Other
125 stars 33 forks source link

Improve array promotion rules #387

Closed nalimilan closed 2 years ago

nalimilan commented 2 years ago

PR #384 added promotion rules that recursively promote the eltype and reftype, but this has the drawback that the resulting type is often not a supertype of the input types, forcing a conversion to a CategoricalArray which may have a Union type. Instead, do the same as Array and AbstractArray fallbacks, which simply call promote_typejoin if eltypes do not match.

nalimilan commented 2 years ago

https://github.com/JuliaRegistries/General/pull/56791