Skip to content

Commit

Permalink
document guarantee that getmetadata returns alias not copy (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrevels authored Apr 7, 2021
1 parent 295416d commit 000d89f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/write.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,16 @@ end
"""
Arrow.getmetadata(x) => Dict{String, String}
Retrieve any metadata (as a `Dict{String, String}`) attached to an object.
Retrieve any metadata (as a `Dict{String, String}`) attached to `x`.
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
this function should preserve this behavior so that downstream callers can rely
on this behavior in generic code.
"""
getmetadata(x, default=nothing) = get(OBJ_METADATA, x, default)

Expand Down

0 comments on commit 000d89f

Please sign in to comment.