queryverse / IterableTables.jl

Implementations of the TableTraits.jl interface for various packages
Other
79 stars 9 forks source link

Change to DataFrames interface breaks getiterator() #80

Closed richardreeve closed 6 years ago

richardreeve commented 6 years ago

In Julia 0.6, a DataFrame works very differently to 0.7 even though both are running DataFrames v0.11.7. In 0.6:

julia> df = DataFrame(count=1:4)
4×1 DataFrames.DataFrame
│ Row │ count │
├─────┼───────┤
│ 1   │ 1     │
│ 2   │ 2     │
│ 3   │ 3     │
│ 4   │ 4     │

julia> df.count
ERROR: type DataFrame has no field count

julia> df.[tab]
colindex columns

In 0.7, however:

julia> using DataFrames

julia> df = DataFrame(count=1:4)
4×1 DataFrame
│ Row │ count │
├─────┼───────┤
│ 1   │ 1     │
│ 2   │ 2     │
│ 3   │ 3     │
│ 4   │ 4     │

julia> df.count # The only completion of df.[tab]
4-element Array{Int64,1}:
 1
 2
 3
 4

As a result, 0.7 errors out when trying to use getiterator():

julia> using IterableTables

julia> IterableTables.getiterator(df)
ERROR: KeyError: key :columns not found
richardreeve commented 6 years ago

BTW, this is true for v0.8.0 and master.