Skip to content

Commit 61dae02

Browse files
davidanthoffquinnj
authored andcommitted
Shim IteratorSize for DataValueRowIterator (#44)
1 parent c3a2062 commit 61dae02

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/datavalues.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@ function datavaluerows(x)
2929
return DataValueRowIterator(datavaluetype(Tables.schema(r)), r)
3030
end
3131

32+
_iteratorsize(x) = x
33+
_iteratorsize(::Base.HasShape{1}) = Base.HasLength()
34+
3235
Base.eltype(rows::DataValueRowIterator{NT, S}) where {NT, S} = NT
33-
Base.IteratorSize(::Type{DataValueRowIterator{NT, S}}) where {NT, S} = Base.IteratorSize(S)
36+
Base.IteratorSize(::Type{DataValueRowIterator{NT, S}}) where {NT, S} = _iteratorsize(Base.IteratorSize(S))
3437
Base.length(rows::DataValueRowIterator) = length(rows.x)
3538

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

0 commit comments

Comments
 (0)