Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document guarantee that getmetadata returns alias not copy #169

Merged
merged 1 commit into from
Apr 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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