tustvold commented on code in PR #4959:
URL: https://github.com/apache/arrow-rs/pull/4959#discussion_r1366867072


##########
arrow-schema/src/schema.rs:
##########
@@ -327,6 +327,27 @@ impl Schema {
                 self.metadata.get(k).map(|v2| v1 == v2).unwrap_or_default()
             })
     }
+
+    /// Remove field by name and return it.
+    ///
+    /// ```
+    /// use arrow_schema::{DataType, Field, Schema};
+    /// let mut schema = Schema::new(vec![
+    ///   Field::new("a", DataType::Boolean, false),
+    ///   Field::new("b", DataType::Int8, false),
+    ///   Field::new("c", DataType::Utf8, false),
+    /// ]);
+    /// assert_eq!(schema.fields.len(), 3);
+    /// assert_eq!(schema.remove_field("b").unwrap(), Field::new("b", 
DataType::Int8, false).into());
+    /// assert_eq!(schema.fields.len(), 2);
+    /// ```
+    pub fn remove_field(&mut self, name: &str) -> Option<FieldRef> {

Review Comment:
   ```suggestion
       pub fn remove_field_with_name(&mut self, name: &str) -> Option<FieldRef> 
{
   ```
   
   For consistency



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to