Skip to content
Permalink
Browse files
fix writing an empty table (#221)
  • Loading branch information
KristofferC committed Jul 6, 2021
1 parent a43a235 commit 911567387746fe5da86b1739c58504d9d317a7b9
Showing 2 changed files with 5 additions and 1 deletion.
@@ -247,7 +247,7 @@ function toarrowtable(cols, dictencodings, largelists, compress, denseunions, di
newtypes[i] = eltype(newcol)
newcols[i] = newcol
end
minlen, maxlen = extrema(length, newcols)
minlen, maxlen = isempty(newcols) ? (0, 0) : extrema(length, newcols)
minlen == maxlen || throw(ArgumentError("columns with unequal lengths detected: $minlen < $maxlen"))
return ToArrowTable(Tables.Schema(sch.names, newtypes), newcols, meta, dictencodingdeltas)
end
@@ -385,6 +385,10 @@ end
@test 5 < length(collect(eachmatch(r"=>", str3))) < 20

end

#194
@test isempty(Arrow.Table(Arrow.tobuffer(Dict{Symbol, Vector}())))

end # @testset "misc"

end

0 comments on commit 9115673

Please sign in to comment.