Skip to content

Commit c4daf7f

Browse files
committed
Remove APIs deprecated in 50.0.0
50.0.0 was released 11 months ago. Remove the APIs that are deprecated since then.
1 parent 93ce75c commit c4daf7f

File tree

4 files changed

+4
-91
lines changed

4 files changed

+4
-91
lines changed

arrow-array/src/ffi_stream.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -379,21 +379,6 @@ impl RecordBatchReader for ArrowArrayStreamReader {
379379
}
380380
}
381381

382-
/// Exports a record batch reader to raw pointer of the C Stream Interface provided by the consumer.
383-
///
384-
/// # Safety
385-
/// Assumes that the pointer represents valid C Stream Interfaces, both in memory
386-
/// representation and lifetime via the `release` mechanism.
387-
#[deprecated(since = "50.0.0", note = "Use FFI_ArrowArrayStream::new")]
388-
pub unsafe fn export_reader_into_raw(
389-
reader: Box<dyn RecordBatchReader + Send>,
390-
out_stream: *mut FFI_ArrowArrayStream,
391-
) {
392-
let stream = FFI_ArrowArrayStream::new(reader);
393-
394-
std::ptr::write_unaligned(out_stream, stream);
395-
}
396-
397382
#[cfg(test)]
398383
mod tests {
399384
use super::*;

arrow-buffer/src/buffer/immutable.rs

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use std::fmt::Debug;
2020
use std::ptr::NonNull;
2121
use std::sync::Arc;
2222

23-
use crate::alloc::{Allocation, Deallocation, ALIGNMENT};
23+
use crate::alloc::{Allocation, Deallocation};
2424
use crate::util::bit_chunk_iterator::{BitChunks, UnalignedBitChunk};
2525
use crate::BufferBuilder;
2626
use crate::{bit_util, bytes::Bytes, native::ArrowNativeType};
@@ -99,26 +99,6 @@ impl Buffer {
9999
buffer.into()
100100
}
101101

102-
/// Creates a buffer from an existing aligned memory region (must already be byte-aligned), this
103-
/// `Buffer` will free this piece of memory when dropped.
104-
///
105-
/// # Arguments
106-
///
107-
/// * `ptr` - Pointer to raw parts
108-
/// * `len` - Length of raw parts in **bytes**
109-
/// * `capacity` - Total allocated memory for the pointer `ptr`, in **bytes**
110-
///
111-
/// # Safety
112-
///
113-
/// This function is unsafe as there is no guarantee that the given pointer is valid for `len`
114-
/// bytes. If the `ptr` and `capacity` come from a `Buffer`, then this is guaranteed.
115-
#[deprecated(since = "50.0.0", note = "Use Buffer::from_vec")]
116-
pub unsafe fn from_raw_parts(ptr: NonNull<u8>, len: usize, capacity: usize) -> Self {
117-
assert!(len <= capacity);
118-
let layout = Layout::from_size_align(capacity, ALIGNMENT).unwrap();
119-
Buffer::build_with_arguments(ptr, len, Deallocation::Standard(layout))
120-
}
121-
122102
/// Creates a buffer from an existing memory region. Ownership of the memory is tracked via reference counting
123103
/// and the memory will be freed using the `drop` method of [crate::alloc::Allocation] when the reference count reaches zero.
124104
///
@@ -322,6 +302,8 @@ impl Buffer {
322302
/// Returns `MutableBuffer` for mutating the buffer if this buffer is not shared.
323303
/// Returns `Err` if this is shared or its allocation is from an external source or
324304
/// it is not allocated with alignment [`ALIGNMENT`]
305+
///
306+
/// [`ALIGNMENT`]: crate::alloc::ALIGNMENT
325307
pub fn into_mutable(self) -> Result<MutableBuffer, Self> {
326308
let ptr = self.ptr;
327309
let length = self.length;

arrow-schema/src/fields.rs

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use std::ops::Deref;
1919
use std::sync::Arc;
2020

21-
use crate::{ArrowError, DataType, Field, FieldRef, SchemaBuilder};
21+
use crate::{ArrowError, DataType, Field, FieldRef};
2222

2323
/// A cheaply cloneable, owned slice of [`FieldRef`]
2424
///
@@ -256,33 +256,6 @@ impl Fields {
256256
.collect();
257257
Ok(filtered)
258258
}
259-
260-
/// Remove a field by index and return it.
261-
///
262-
/// # Panic
263-
///
264-
/// Panics if `index` is out of bounds.
265-
///
266-
/// # Example
267-
/// ```
268-
/// use arrow_schema::{DataType, Field, Fields};
269-
/// let mut fields = Fields::from(vec![
270-
/// Field::new("a", DataType::Boolean, false),
271-
/// Field::new("b", DataType::Int8, false),
272-
/// Field::new("c", DataType::Utf8, false),
273-
/// ]);
274-
/// assert_eq!(fields.len(), 3);
275-
/// assert_eq!(fields.remove(1), Field::new("b", DataType::Int8, false).into());
276-
/// assert_eq!(fields.len(), 2);
277-
/// ```
278-
#[deprecated(since = "50.0.0", note = "Use SchemaBuilder::remove")]
279-
#[doc(hidden)]
280-
pub fn remove(&mut self, index: usize) -> FieldRef {
281-
let mut builder = SchemaBuilder::from(Fields::from(&*self.0));
282-
let field = builder.remove(index);
283-
*self = builder.finish().fields;
284-
field
285-
}
286259
}
287260

288261
impl Default for Fields {

arrow-schema/src/schema.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -434,33 +434,6 @@ impl Schema {
434434
.iter()
435435
.all(|(k, v1)| self.metadata.get(k).map(|v2| v1 == v2).unwrap_or_default())
436436
}
437-
438-
/// Remove field by index and return it. Recommend to use [`SchemaBuilder`]
439-
/// if you are looking to remove multiple columns, as this will save allocations.
440-
///
441-
/// # Panic
442-
///
443-
/// Panics if `index` is out of bounds.
444-
///
445-
/// # Example
446-
///
447-
/// ```
448-
/// use arrow_schema::{DataType, Field, Schema};
449-
/// let mut schema = Schema::new(vec![
450-
/// Field::new("a", DataType::Boolean, false),
451-
/// Field::new("b", DataType::Int8, false),
452-
/// Field::new("c", DataType::Utf8, false),
453-
/// ]);
454-
/// assert_eq!(schema.fields.len(), 3);
455-
/// assert_eq!(schema.remove(1), Field::new("b", DataType::Int8, false).into());
456-
/// assert_eq!(schema.fields.len(), 2);
457-
/// ```
458-
#[deprecated(since = "50.0.0", note = "Use SchemaBuilder::remove")]
459-
#[doc(hidden)]
460-
#[allow(deprecated)]
461-
pub fn remove(&mut self, index: usize) -> FieldRef {
462-
self.fields.remove(index)
463-
}
464437
}
465438

466439
impl fmt::Display for Schema {

0 commit comments

Comments
 (0)