Skip to content

Commit

Permalink
Shim IteratorSize for DataValueRowIterator (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidanthoff authored and quinnj committed Nov 13, 2018
1 parent c3a2062 commit 61dae02
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/datavalues.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ function datavaluerows(x)
return DataValueRowIterator(datavaluetype(Tables.schema(r)), r)
end

_iteratorsize(x) = x
_iteratorsize(::Base.HasShape{1}) = Base.HasLength()

Base.eltype(rows::DataValueRowIterator{NT, S}) where {NT, S} = NT
Base.IteratorSize(::Type{DataValueRowIterator{NT, S}}) where {NT, S} = Base.IteratorSize(S)
Base.IteratorSize(::Type{DataValueRowIterator{NT, S}}) where {NT, S} = _iteratorsize(Base.IteratorSize(S))
Base.length(rows::DataValueRowIterator) = length(rows.x)

function Base.iterate(rows::DataValueRowIterator{NT, S}, st=()) where {NT <: NamedTuple{names}, S} where {names}
Expand Down

0 comments on commit 61dae02

Please sign in to comment.