From c21349ad7e10251e039693a72a31df72eaaf2fc9 Mon Sep 17 00:00:00 2001 From: Raphael Taylor-Davies Date: Wed, 29 Nov 2023 11:29:07 +0000 Subject: [PATCH] Deprecate Fields::remove Schema::remove --- arrow-schema/src/fields.rs | 2 ++ arrow-schema/src/schema.rs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/arrow-schema/src/fields.rs b/arrow-schema/src/fields.rs index 70cb1968e9a4..f90632455fd9 100644 --- a/arrow-schema/src/fields.rs +++ b/arrow-schema/src/fields.rs @@ -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); diff --git a/arrow-schema/src/schema.rs b/arrow-schema/src/schema.rs index 711e4cb3314d..e547e5df3a5a 100644 --- a/arrow-schema/src/schema.rs +++ b/arrow-schema/src/schema.rs @@ -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) }