Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/tofromdatavalues.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,15 @@ IteratorInterfaceExtensions.getiterator(x::MyTable) = Tables.datavaluerows(x)
```
"""
function datavaluerows(x)
r = Tables.rows(x)
x2 = if Tables.columnaccess(x)
Tables.columntable(x)
elseif Tables.rowaccess(x)
x
else
error("Invalid input table, must either declare to have a Tables.rows or Tables.columns method.")
end

r = Tables.rows(x2)
s = Tables.schema(r)
s === nothing && error("Schemaless sources cannot be passed to datavaluerows.")
return DataValueRowIterator{datavaluenamedtuple(s), typeof(s), typeof(r)}(r)
Expand Down