Tables.jl
Tables.jl copied to clipboard
Tables.materializer with structure type arguments
I was trying to obtain the sink function using only the type of the structure. Only way to do that was to create an empty structure using a constructor with no args. This assumes the structure would have one available
Is there any better way to do this?
Docs are stating a table
input, so the behavior is consistent with the docs, but I think getting a sink using a type would be useful in some cases.
julia> type = DataFrame
DataFrame
julia> Tables.materializer(type)
columntable (generic function with 5 methods)
julia> Tables.materializer(type())
DataFrame
I just hit exactly this same issue.
Generally, the docs aren't totally clear on which interface methods take a type and which take a value, and table
gets used interchangeably to refer to a type (istable
) or a value (materializer
)
As commented in Slack, I think materializer should act on an instance, not the type, for consistency with other Tables.jl functions.