Skip to content
Browse files
Tweak promoteunion to always avoid abstract types (#162)
This makes the 2nd `concretecheck` unnecessary in the `ToArrow`
constructor, but we'll leave it for now as a type of assert. This came
from a discussion with @IAMED on slack, where it was pointed out that
values always have a concrete type at runtime (yay Julia!), so we should
_always_ be able to get a `Union{...}` of concrete types. This could
potentially get crazy if someone has, like, thousands of unique concrete
types in a single array, but I guess we'll cross that bridge when we
come to it.
  • Loading branch information
quinnj committed Apr 1, 2021
1 parent 6955392 commit 86ef3450204a7be67519c7de0d79879f136f9e45
Showing 1 changed file with 1 addition and 1 deletion.
@@ -305,7 +305,7 @@ default(::Type{NamedTuple{names, types}}) where {names, types} = NamedTuple{name

function promoteunion(T, S)
new = promote_type(T, S)
return new === Any ? Union{T, S} : new
return isabstracttype(new) ? Union{T, S} : new

# lazily call toarrow(x) on getindex for each x in data

0 comments on commit 86ef345

Please sign in to comment.