omus opened a new pull request, #385:
URL: https://github.com/apache/arrow-julia/pull/385
Addresses an issue introduced in #371:
```julia
julia> ArrowTypes.ToArrow(Union{Missing, Array{Int}}[missing])
ERROR: MethodError: no method matching zero(::Type{Union{Missing,
Array{Int64}}})
Closest candidates are:
zero(::Type{Union{Missing, T}}) where T at missing.jl:105
zero(::Union{Type{P}, P}) where P<:Dates.Period at
~/Development/Julia/aarch64/1.8/usr/share/julia/stdlib/v1.8/Dates/src/periods.jl:53
zero(::LinearAlgebra.Diagonal) at
~/Development/Julia/aarch64/1.8/usr/share/julia/stdlib/v1.8/LinearAlgebra/src/special.jl:381
...
Stacktrace:
[1] default(T::Type)
@ ArrowTypes ~/.julia/dev/Arrow/src/ArrowTypes/src/ArrowTypes.jl:303
[2] ToArrow(x::Vector{Union{Missing, Array{Int64}}})
@ ArrowTypes ~/.julia/dev/Arrow/src/ArrowTypes/src/ArrowTypes.jl:353
[3] top-level scope
@ REPL[2]:1
```
This error can occur when `eltype` of the array is non-concrete and all of
the elements in the array are `missing`.
The approach in #371 doesn't work well with abstract `eltype`s as it uses
`ArrowTypes.default` (i.e. what instance would `ArrowTypes.default(Array{Int})`
return?). So this PR restricts the solution from #371 to only concrete
`eltype`s.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]