You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by tu...@apache.org on 2023/11/29 12:45:24 UTC
(arrow-rs) branch master updated: Deprecate Fields::remove Schema::remove (#5144)
This is an automated email from the ASF dual-hosted git repository.
tustvold pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/master by this push:
new cfdb505c97 Deprecate Fields::remove Schema::remove (#5144)
cfdb505c97 is described below
commit cfdb505c97820426425b70fc8fe89022a35944a6
Author: Raphael Taylor-Davies <17...@users.noreply.github.com>
AuthorDate: Wed Nov 29 12:45:18 2023 +0000
Deprecate Fields::remove Schema::remove (#5144)
---
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 70cb1968e9..f90632455f 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 711e4cb331..e547e5df3a 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)
}