From 143a27c22aed25907f6a0d0b488b900a66568cfb Mon Sep 17 00:00:00 2001 From: Jarrett Revels Date: Tue, 6 Apr 2021 18:27:32 -0400 Subject: [PATCH] document guarantee that `getmetadata` returns alias not copy --- src/write.jl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/write.jl b/src/write.jl index 3928c5f7..146fda75 100644 --- a/src/write.jl +++ b/src/write.jl @@ -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)