Skip to content

Commit 125c1e7

Browse files
authored
fix propagation of maxdepth kwarg (#181)
* fix propagation of maxdepth kwarg * bump Project.toml
1 parent 1af27ba commit 125c1e7

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Arrow"
22
uuid = "69666777-d1a9-59fb-9406-91d4454c9d45"
33
authors = ["quinnj <quinn.jacobd@gmail.com>"]
4-
version = "1.4.0"
4+
version = "1.4.1"
55

66
[deps]
77
BitIntegers = "c3b6d118-76ef-56ca-8cc7-ebb389d030a1"

src/arraytypes/arraytypes.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function arrowvector(x, i, nl, fi, de, ded, meta; dictencoding::Bool=false, dict
5656
if !(x isa DictEncode) && !dictencoding && (dictencode || DataAPI.refarray(x) !== x)
5757
x = DictEncode(x, dictencodeid(i, nl, fi))
5858
elseif x isa DictEncoded
59-
return arrowvector(DictEncodeType, x, i, nl, fi, de, ded, meta; dictencode=dictencode, kw...)
59+
return arrowvector(DictEncodeType, x, i, nl, fi, de, ded, meta; dictencode=dictencode, kw...)
6060
elseif !(x isa DictEncode)
6161
x = ToArrow(x)
6262
end
@@ -66,7 +66,7 @@ function arrowvector(x, i, nl, fi, de, ded, meta; dictencoding::Bool=false, dict
6666
meta["ARROW:extension:name"] = String(ArrowTypes.arrowname(T))
6767
meta["ARROW:extension:metadata"] = String(ArrowTypes.arrowmetadata(T))
6868
end
69-
return arrowvector(S, x, i, nl, fi, de, ded, meta; dictencode=dictencode, kw...)
69+
return arrowvector(S, x, i, nl, fi, de, ded, meta; dictencode=dictencode, maxdepth=maxdepth, kw...)
7070
end
7171

7272
# now we check for ArrowType converions and dispatch on ArrowKind

src/write.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ Metadata may be attached to any object via [`Arrow.setmetadata!`](@ref),
3737
or deserialized via the arrow format directly (the format allows attaching metadata
3838
to table, column, and other objects).
3939
40-
Note that this function's return value directly aliases `x`'s attached metadata
41-
(i.e. is not a copy of the underlying storage). Any method author that overloads
40+
Note that this function's return value directly aliases `x`'s attached metadata
41+
(i.e. is not a copy of the underlying storage). Any method author that overloads
4242
this function should preserve this behavior so that downstream callers can rely
4343
on this behavior in generic code.
4444
"""

test/runtests.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,17 @@ tbl = Arrow.Table(bytes)
308308
@test length(tbl.a) == 0
309309
@test eltype(tbl.a) == Union{Int64, Missing}
310310

311+
# 181
312+
tbl = (x = [Dict()],)
313+
d = tbl.x[];
314+
for i in 1:20
315+
d[i] = Dict()
316+
d = d[i]
317+
end
318+
msg = "reached nested serialization level (42) deeper than provided max depth argument (41); to increase allowed nesting level, pass `maxdepth=X`"
319+
@test_throws ErrorException(msg) Arrow.tobuffer(tbl; maxdepth=41).x
320+
@test Arrow.Table(Arrow.tobuffer(tbl; maxdepth=42)).x == tbl.x
321+
311322
end # @testset "misc"
312323

313324
end

0 commit comments

Comments
 (0)