baumgold commented on PR #456:
URL: https://github.com/apache/arrow-julia/pull/456#issuecomment-1581674295
I was able to reproduce this with the following:
```julia
julia> NT = @NamedTuple{x::Int, y::Union{Missing,Int}};
julia> data = NT[(x=1,y=2), (x=2,y=missing), (x=3,y=4), (x=4,y=5)];
julia> t = [(a=1,b=view(data,1:2)), (a=2,b=view(data,3:4)), missing];
julia> Arrow.toarrowvector(t);
ERROR: MethodError: no method matching SubArray{NamedTuple{(:x, :y),
Tuple{Int64, Union{Missing, Int64}}}, 1, Vector{NamedTuple{(:x, :y),
Tuple{Int64, Union{Missing, Int64}}}}, Tuple{UnitRange{Int64}},
true}(::UndefInitializer, ::Tuple{Int64})
```
Note after I added the suggested solution from this PR, I now get the error
in #458:
```julia
julia> Arrow.ArrowTypes.default(::Type{SubArray{T,N,P,I,L}}) where
{T,N,P,I,L} = Arrow.ArrowTypes.default(P);
julia> Arrow.toarrowvector(t);
ERROR: MethodError: Cannot `convert` an object of type
Vector{NamedTuple{(:x, :y), Tuple{Int64, Union{Missing, Int64}}}} to an object
of type SubArray{NamedTuple{(:x, :y), Tuple{Int64, Union{Missing, Int64}}}, 1,
Vector{NamedTuple{(:x, :y), Tuple{Int64, Union{Missing, Int64}}}},
Tuple{UnitRange{Int64}}, true}
```
--
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]