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:
[email protected]


Reply via email to