Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
quinnj committed Sep 19, 2018
1 parent dc1a6ce commit 1f5f724
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/fallbacks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function buildcolumns(::Nothing, rowitr::T) where {T}
state = iterate(rowitr)
state === nothing && return NamedTuple()
row, st = state
names = propertynames(row)
names = Tuple(propertynames(row))
L = Base.IteratorSize(T)
len = haslength(L) ? length(rowitr) : 0
sch = Schema(names, nothing)
Expand All @@ -112,7 +112,7 @@ function _buildcolumns(rowitr, row, st, sch, L, columns, rownbr, len, updated)
row, st = state
columns !== updated[] && return _buildcolumns(rowitr, row, st, sch, L, updated[], rownbr, len, updated)
end
return columns
return updated[]
end

@inline function columns(x::T) where {T}
Expand Down
2 changes: 1 addition & 1 deletion src/namedtuples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function columntable(sch::Schema{names, types}, cols) where {names, types}
end
end
# unknown schema case
columntable(::Nothing, cols) = NamedTuple{propertynames(cols)}(Tuple(getarray(col) for col in eachcolumn(cols)))
columntable(::Nothing, cols) = NamedTuple{Tuple(propertynames(cols))}(Tuple(getarray(col) for col in eachcolumn(cols)))

function columntable(itr::T) where {T}
istable(T) || throw(ArgumentError("NamedTuple of AbstractVectors requires a table input"))
Expand Down

0 comments on commit 1f5f724

Please sign in to comment.