Skip to content

Commit 950bf4b

Browse files
davidanthoffquinnj
authored andcommitted
Avoid intermediate copy of table for TableTraits sources (#67)
1 parent e4c94b7 commit 950bf4b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/datavalues.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ DataValueRowIterator(::Type{NT}, x::S) where {NT <: NamedTuple, S} = DataValueRo
2424
DataValueRowIterator(::Type{Schema{names, types}}, x::S) where {names, types, S} = DataValueRowIterator{datavaluetype(NamedTuple{names, types}), S}(x)
2525

2626
function datavaluerows(x)
27-
r = Tables.rowtable(x)
28-
return DataValueRowIterator(datavaluetype(Tables.schema(r)), r)
27+
r = Tables.rows(x)
28+
s = Tables.schema(r)
29+
s === nothing && error("Schemaless sources cannot be passed to datavaluerows.")
30+
return DataValueRowIterator(datavaluetype(s), r)
2931
end
3032

3133
_iteratorsize(x) = x

0 commit comments

Comments
 (0)