Skip to content
Permalink
Browse files
fix propagation of maxdepth kwarg (#181)
* fix propagation of maxdepth kwarg

* bump Project.toml
  • Loading branch information
jrevels committed Apr 23, 2021
1 parent 1af27ba commit 125c1e722406d866ccc350351da71e83ffe10edd
Showing 4 changed files with 16 additions and 5 deletions.
@@ -1,7 +1,7 @@
name = "Arrow"
uuid = "69666777-d1a9-59fb-9406-91d4454c9d45"
authors = ["quinnj <quinn.jacobd@gmail.com>"]
version = "1.4.0"
version = "1.4.1"

[deps]
BitIntegers = "c3b6d118-76ef-56ca-8cc7-ebb389d030a1"
@@ -56,7 +56,7 @@ function arrowvector(x, i, nl, fi, de, ded, meta; dictencoding::Bool=false, dict
if !(x isa DictEncode) && !dictencoding && (dictencode || DataAPI.refarray(x) !== x)
x = DictEncode(x, dictencodeid(i, nl, fi))
elseif x isa DictEncoded
return arrowvector(DictEncodeType, x, i, nl, fi, de, ded, meta; dictencode=dictencode, kw...)
return arrowvector(DictEncodeType, x, i, nl, fi, de, ded, meta; dictencode=dictencode, kw...)
elseif !(x isa DictEncode)
x = ToArrow(x)
end
@@ -66,7 +66,7 @@ function arrowvector(x, i, nl, fi, de, ded, meta; dictencoding::Bool=false, dict
meta["ARROW:extension:name"] = String(ArrowTypes.arrowname(T))
meta["ARROW:extension:metadata"] = String(ArrowTypes.arrowmetadata(T))
end
return arrowvector(S, x, i, nl, fi, de, ded, meta; dictencode=dictencode, kw...)
return arrowvector(S, x, i, nl, fi, de, ded, meta; dictencode=dictencode, maxdepth=maxdepth, kw...)
end

# now we check for ArrowType converions and dispatch on ArrowKind
@@ -37,8 +37,8 @@ Metadata may be attached to any object via [`Arrow.setmetadata!`](@ref),
or deserialized via the arrow format directly (the format allows attaching metadata
to table, column, and other objects).
Note that this function's return value directly aliases `x`'s attached metadata
(i.e. is not a copy of the underlying storage). Any method author that overloads
Note that this function's return value directly aliases `x`'s attached metadata
(i.e. is not a copy of the underlying storage). Any method author that overloads
this function should preserve this behavior so that downstream callers can rely
on this behavior in generic code.
"""
@@ -308,6 +308,17 @@ tbl = Arrow.Table(bytes)
@test length(tbl.a) == 0
@test eltype(tbl.a) == Union{Int64, Missing}

# 181
tbl = (x = [Dict()],)
d = tbl.x[];
for i in 1:20
d[i] = Dict()
d = d[i]
end
msg = "reached nested serialization level (42) deeper than provided max depth argument (41); to increase allowed nesting level, pass `maxdepth=X`"
@test_throws ErrorException(msg) Arrow.tobuffer(tbl; maxdepth=41).x
@test Arrow.Table(Arrow.tobuffer(tbl; maxdepth=42)).x == tbl.x

end # @testset "misc"

end

2 comments on commit 125c1e7

@quinnj
Copy link
Member

@quinnj quinnj commented on 125c1e7 Apr 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

@JuliaRegistrator JuliaRegistrator commented on 125c1e7 Apr 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/35084

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.4.1 -m "<description of version>" 125c1e722406d866ccc350351da71e83ffe10edd
git push origin v1.4.1

Please sign in to comment.