We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Whereas #16 deals w/ constructing optional structs, here are a couple issues deconstructing them:
using Arrow: Arrow using Strapping: Strapping using StructTypes: StructTypes # Types # N.B. Making `TInterval` an alias for `Int` avoids both errors below # const TInterval = Int struct TInterval a::Int end StructTypes.StructType(::Type{TInterval}) = StructTypes.Struct() struct StopLoc b::Int # N.B. Missing has the same issues as Nothing hours::Union{Nothing,TInterval} end StructTypes.StructType(::Type{StopLoc}) = StructTypes.Struct() struct Trip start::StopLoc finish::StopLoc end StructTypes.StructType(::Type{Trip}) = StructTypes.Struct() struct TripEnd finish::StopLoc end TripEnd(t::Trip) = TripEnd(t.finish) StructTypes.StructType(::Type{TripEnd}) = StructTypes.Struct() # Generate data trips = [ Trip(StopLoc(1, nothing), StopLoc(2, nothing)), Trip(StopLoc(2, TInterval(1)), StopLoc(3, TInterval(2))), ] trip_ends = TripEnd.(trips) # Deconstruct de_trips = Strapping.deconstruct(trips) Arrow.write("de_trips.arrow", de_trips) # => ERROR: # LoadError: duplicate field name in NamedTuple: "finish_lng" is not unique de_trip_ends = Strapping.deconstruct(trip_ends) Arrow.write("de_trip_ends.arrow", de_trip_ends) # => ERROR: # LoadError: AssertionError: fn === nothing
The text was updated successfully, but these errors were encountered:
Union{T, Nothing}
No branches or pull requests
Whereas #16 deals w/ constructing optional structs, here are a couple issues deconstructing them:
The text was updated successfully, but these errors were encountered: