You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/01/06 13:19:39 UTC

[GitHub] [arrow] mqy commented on a change in pull request #9025: ARROW-10259: [Rust] Add custom metadata to Field

mqy commented on a change in pull request #9025:
URL: https://github.com/apache/arrow/pull/9025#discussion_r552601425



##########
File path: rust/arrow/src/datatypes.rs
##########
@@ -1296,9 +1301,31 @@ impl Field {
             nullable,
             dict_id,
             dict_is_ordered,
+            metadata: None,
         }
     }
 
+    /// Sets the `Field`'s optional custom metadata.
+    /// The metadata is set as `None` for empty map.
+    /// Return cloned `Self`.
+    #[inline]
+    pub fn with_metadata(&mut self, metadata: Option<BTreeMap<String, String>>) -> Self {

Review comment:
       @nevi-me I totally agree that the cloned behavior is a bug instead of coding style problem.
   I had fixed it per your suggestion and renamed the function from `with_metadata` to `set_metadata` without any return value.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org