JuliaData / Tables.jl

An interface for tables in Julia
https://juliadata.github.io/Tables.jl/stable/
MIT License
302 stars 54 forks source link

Unexpected complaint about too-wide a table #357

Open ablaom opened 4 days ago

ablaom commented 4 days ago

I don't expect tables with 5 columns to be "too wide". Should I?

Pkg.activate(temp=true)
Pkg.add("Tables")
Pkg.add("OpenML")

using OpenML, Tables

# [8b6db2d4] OpenML v0.3.2
# [bd369af6] Tables v1.12.0

table = OpenML.load(61)
# Tables.DictColumnTable with 150 rows, 5 columns, and schema:
#  :sepallength  Float64
#  :sepalwidth   Float64
#  :petallength  Float64
#  :petalwidth   Float64
#  :class        CategoricalArrays.CategoricalValue{String, UInt32}

Tables.columntable(table)
# ERROR: ArgumentError: input table too wide (5 columns) to convert to `NamedTuple` of `AbstractVector`s
# Stacktrace:
#  [1] columntable(sch::Tables.Schema{nothing, nothing}, cols::Tables.DictColumnTable)
#    @ Tables ~/.julia/packages/Tables/8p03y/src/namedtuples.jl:180
#  [2] columntable(itr::Tables.DictColumnTable)
#    @ Tables ~/.julia/packages/Tables/8p03y/src/namedtuples.jl:190
#  [3] top-level scope
#    @ REPL[7]:1
ablaom commented 4 days ago

@jbrea Have you run into this kind of thing?

jbrea commented 4 days ago

Weird. No, I usually use DataFrames, which work fine on this example.