Skip to content

Commit

Permalink
Update src/tofromdatavalues.jl
Browse files Browse the repository at this point in the history
Co-authored-by: Jacob Quinn <[email protected]>
  • Loading branch information
davidanthoff and quinnj committed Apr 10, 2022
1 parent 06d0ed5 commit 3ddc401
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/tofromdatavalues.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,7 @@ IteratorInterfaceExtensions.getiterator(x::MyTable) = Tables.datavaluerows(x)
```
"""
function datavaluerows(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)
r = Tables.rows(Tables.columnaccess(x) ? Tables.columntable(x) : x)
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

0 comments on commit 3ddc401

Please sign in to comment.