Skip to content

Commit

Permalink
Deprecate Fields::remove Schema::remove
Browse files Browse the repository at this point in the history
  • Loading branch information
tustvold committed Nov 29, 2023
1 parent ef6932f commit c21349a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arrow-schema/src/fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ impl Fields {
/// assert_eq!(fields.remove(1), Field::new("b", DataType::Int8, false).into());
/// assert_eq!(fields.len(), 2);
/// ```
#[deprecated(note = "Use SchemaBuilder::remove")]
#[doc(hidden)]
pub fn remove(&mut self, index: usize) -> FieldRef {
let mut builder = SchemaBuilder::from(Fields::from(&*self.0));
let field = builder.remove(index);
Expand Down
3 changes: 3 additions & 0 deletions arrow-schema/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,9 @@ impl Schema {
/// assert_eq!(schema.remove(1), Field::new("b", DataType::Int8, false).into());
/// assert_eq!(schema.fields.len(), 2);
/// ```
#[deprecated(note = "Use SchemaBuilder::remove")]
#[doc(hidden)]
#[allow(deprecated)]
pub fn remove(&mut self, index: usize) -> FieldRef {
self.fields.remove(index)
}
Expand Down

0 comments on commit c21349a

Please sign in to comment.