You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia>using Arrow, Intervals
julia> table = (col = [
Interval{Closed,Unbounded}(1,nothing),
],)
(col = Interval{Int64,Closed,Unbounded}[Interval{Int64,Closed,Unbounded}(1, nothing)],)
julia> table.col
1-element Array{Interval{Int64,Closed,Unbounded},1}:Interval{Int64,Closed,Unbounded}(1, nothing)
julia> Arrow.write("un.arrow", table);
julia> Arrow.Table("un.arrow").col
1-element Arrow.Struct{Interval{Int64,Closed,Unbounded},Tuple{Arrow.Primitive{Int64,Array{Int64,1}},Arrow.Primitive{Int64,Array{Int64,1}}}}:
Error showing value of type Arrow.Struct{Interval{Int64,Closed,Unbounded},Tuple{Arrow.Primitive{Int64,Array{Int64,1}},Arrow.Primitive{Int64,Array{Int64,1}}}}:
ERROR: MethodError: no method matching Interval{Int64,Closed,Unbounded}(::Int64, ::Int64)
Closest candidates are:Interval{Int64,Closed,Unbounded}(::T, ::T, ::Inclusivity) where {T, L, R} at /Users/omus/.julia/dev/Intervals/src/deprecated.jl:34Interval{Int64,Closed,Unbounded}(::Any, ::Any, ::Inclusivity) where {T, L, R} at /Users/omus/.julia/dev/Intervals/src/deprecated.jl:44Interval{Int64,Closed,Unbounded}(::T, ::Nothing) where {T, L<:Intervals.Bounded, R<:Unbounded} at /Users/omus/.julia/dev/Intervals/src/interval.jl:87...
The core of the problem here is that Interval{T,L,R} contains two fields :first and :last which must both be of type T. When constructing an unbounded interval we use nothing to represent unbounded in the constructor but internally just store an arbitrary value of T for the unbounded endpoint. I'll note that native Julia serialization doesn't encounter this problem.
One workaround would be to have Arrow.jl provided callback when constructing the Julia type. That way we could revise the constructor arguments based upon the parametric types.
The text was updated successfully, but these errors were encountered:
The core of the problem here is that
Interval{T,L,R}
contains two fields:first
and:last
which must both be of typeT
. When constructing an unbounded interval we usenothing
to represent unbounded in the constructor but internally just store an arbitrary value ofT
for the unbounded endpoint. I'll note that native Julia serialization doesn't encounter this problem.One workaround would be to have Arrow.jl provided callback when constructing the Julia type. That way we could revise the constructor arguments based upon the parametric types.
The text was updated successfully, but these errors were encountered: