diff --git a/arrow-arith/src/arity.rs b/arrow-arith/src/arity.rs index bb983e1225ac..a6f5780056aa 100644 --- a/arrow-arith/src/arity.rs +++ b/arrow-arith/src/arity.rs @@ -104,7 +104,7 @@ where } /// Applies an infallible unary function to an array with primitive values. -#[deprecated(note = "Use arrow_array::AnyDictionaryArray")] +#[deprecated(since = "46.0.0", note = "Use arrow_array::AnyDictionaryArray")] pub fn unary_dyn(array: &dyn Array, op: F) -> Result where T: ArrowPrimitiveType, @@ -130,7 +130,7 @@ where } /// Applies a fallible unary function to an array with primitive values. -#[deprecated(note = "Use arrow_array::AnyDictionaryArray")] +#[deprecated(since = "46.0.0", note = "Use arrow_array::AnyDictionaryArray")] pub fn try_unary_dyn(array: &dyn Array, op: F) -> Result where T: ArrowPrimitiveType, diff --git a/arrow-arith/src/temporal.rs b/arrow-arith/src/temporal.rs index 09d690d3237c..7cbe56c17fd0 100644 --- a/arrow-arith/src/temporal.rs +++ b/arrow-arith/src/temporal.rs @@ -669,7 +669,7 @@ impl ChronoDateExt for T { /// /// Note that the offset is function of time and can vary depending on whether daylight savings is /// in effect or not. e.g. Australia/Sydney is +10:00 or +11:00 depending on DST. -#[deprecated(note = "Use arrow_array::timezone::Tz instead")] +#[deprecated(since = "26.0.0", note = "Use arrow_array::timezone::Tz instead")] pub fn using_chrono_tz_and_utc_naive_date_time( tz: &str, utc: NaiveDateTime, diff --git a/arrow-array/src/array/binary_array.rs b/arrow-array/src/array/binary_array.rs index 401a60d4d8a0..350661a85d1f 100644 --- a/arrow-array/src/array/binary_array.rs +++ b/arrow-array/src/array/binary_array.rs @@ -25,7 +25,7 @@ pub type GenericBinaryArray = GenericByteArray GenericBinaryArray { /// Get the data type of the array. - #[deprecated(note = "please use `Self::DATA_TYPE` instead")] + #[deprecated(since = "20.0.0", note = "please use `Self::DATA_TYPE` instead")] pub const fn get_data_type() -> DataType { Self::DATA_TYPE } diff --git a/arrow-array/src/array/fixed_size_binary_array.rs b/arrow-array/src/array/fixed_size_binary_array.rs index 83de50fd9158..83e984459760 100644 --- a/arrow-array/src/array/fixed_size_binary_array.rs +++ b/arrow-array/src/array/fixed_size_binary_array.rs @@ -237,6 +237,7 @@ impl FixedSizeBinaryArray { /// /// Returns error if argument has length zero, or sizes of nested slices don't match. #[deprecated( + since = "28.0.0", note = "This function will fail if the iterator produces only None values; prefer `try_from_sparse_iter_with_size`" )] pub fn try_from_sparse_iter(mut iter: T) -> Result diff --git a/arrow-array/src/array/primitive_array.rs b/arrow-array/src/array/primitive_array.rs index 22768cfa5139..ae394b588b7f 100644 --- a/arrow-array/src/array/primitive_array.rs +++ b/arrow-array/src/array/primitive_array.rs @@ -1481,7 +1481,7 @@ def_numeric_from_vec!(TimestampNanosecondType); impl PrimitiveArray { /// Construct a timestamp array from a vec of i64 values and an optional timezone - #[deprecated(note = "Use with_timezone_opt instead")] + #[deprecated(since = "26.0.0", note = "Use with_timezone_opt instead")] pub fn from_vec(data: Vec, timezone: Option) -> Self where Self: From>, @@ -1490,7 +1490,7 @@ impl PrimitiveArray { } /// Construct a timestamp array from a vec of `Option` values and an optional timezone - #[deprecated(note = "Use with_timezone_opt instead")] + #[deprecated(since = "26.0.0", note = "Use with_timezone_opt instead")] pub fn from_opt_vec(data: Vec>, timezone: Option) -> Self where Self: From>>, diff --git a/arrow-array/src/array/string_array.rs b/arrow-array/src/array/string_array.rs index d7011e397ecd..c87c797bcf2b 100644 --- a/arrow-array/src/array/string_array.rs +++ b/arrow-array/src/array/string_array.rs @@ -24,7 +24,7 @@ pub type GenericStringArray = GenericByteArray GenericStringArray { /// Get the data type of the array. - #[deprecated(note = "please use `Self::DATA_TYPE` instead")] + #[deprecated(since = "20.0.0", note = "please use `Self::DATA_TYPE` instead")] pub const fn get_data_type() -> DataType { Self::DATA_TYPE } diff --git a/arrow-array/src/builder/generic_bytes_view_builder.rs b/arrow-array/src/builder/generic_bytes_view_builder.rs index d12c2b7db468..7268e751b149 100644 --- a/arrow-array/src/builder/generic_bytes_view_builder.rs +++ b/arrow-array/src/builder/generic_bytes_view_builder.rs @@ -136,7 +136,7 @@ impl GenericByteViewBuilder { /// Override the size of buffers to allocate for holding string data /// Use `with_fixed_block_size` instead. - #[deprecated(note = "Use `with_fixed_block_size` instead")] + #[deprecated(since = "53.0.0", note = "Use `with_fixed_block_size` instead")] pub fn with_block_size(self, block_size: u32) -> Self { self.with_fixed_block_size(block_size) } diff --git a/arrow-array/src/cast.rs b/arrow-array/src/cast.rs index 232b29560cbf..fd83104a6a42 100644 --- a/arrow-array/src/cast.rs +++ b/arrow-array/src/cast.rs @@ -690,7 +690,10 @@ array_downcast_fn!(as_union_array, UnionArray); array_downcast_fn!(as_map_array, MapArray); /// Force downcast of an Array, such as an ArrayRef to Decimal128Array, panic’ing on failure. -#[deprecated(note = "please use `as_primitive_array::` instead")] +#[deprecated( + since = "42.0.0", + note = "please use `as_primitive_array::` instead" +)] pub fn as_decimal_array(arr: &dyn Array) -> &PrimitiveArray { as_primitive_array::(arr) } diff --git a/arrow-array/src/ffi.rs b/arrow-array/src/ffi.rs index 4426e0986409..7c1e04bc7e78 100644 --- a/arrow-array/src/ffi.rs +++ b/arrow-array/src/ffi.rs @@ -121,7 +121,10 @@ type Result = std::result::Result; /// This function copies the content of two FFI structs [arrow_data::ffi::FFI_ArrowArray] and /// [arrow_schema::ffi::FFI_ArrowSchema] in the array to the location pointed by the raw pointers. /// Usually the raw pointers are provided by the array data consumer. -#[deprecated(note = "Use FFI_ArrowArray::new and FFI_ArrowSchema::try_from")] +#[deprecated( + since = "52.0.0", + note = "Use FFI_ArrowArray::new and FFI_ArrowSchema::try_from" +)] pub unsafe fn export_array_into_raw( src: ArrayRef, out_array: *mut FFI_ArrowArray, diff --git a/arrow-array/src/ffi_stream.rs b/arrow-array/src/ffi_stream.rs index 34f0cd7cfc74..0d4a3f3b39a7 100644 --- a/arrow-array/src/ffi_stream.rs +++ b/arrow-array/src/ffi_stream.rs @@ -384,7 +384,7 @@ impl RecordBatchReader for ArrowArrayStreamReader { /// # Safety /// Assumes that the pointer represents valid C Stream Interfaces, both in memory /// representation and lifetime via the `release` mechanism. -#[deprecated(note = "Use FFI_ArrowArrayStream::new")] +#[deprecated(since = "50.0.0", note = "Use FFI_ArrowArrayStream::new")] pub unsafe fn export_reader_into_raw( reader: Box, out_stream: *mut FFI_ArrowArrayStream, diff --git a/arrow-array/src/types.rs b/arrow-array/src/types.rs index 92262fc04a57..4e05349cd089 100644 --- a/arrow-array/src/types.rs +++ b/arrow-array/src/types.rs @@ -69,7 +69,7 @@ pub trait ArrowPrimitiveType: primitive::PrimitiveTypeSealed + 'static { const DATA_TYPE: DataType; /// Returns the byte width of this primitive type. - #[deprecated(note = "Use ArrowNativeType::get_byte_width")] + #[deprecated(since = "52.0.0", note = "Use ArrowNativeType::get_byte_width")] fn get_byte_width() -> usize { std::mem::size_of::() } @@ -325,7 +325,7 @@ pub trait ArrowTimestampType: ArrowTemporalType { const UNIT: TimeUnit; /// Returns the `TimeUnit` of this timestamp. - #[deprecated(note = "Use Self::UNIT")] + #[deprecated(since = "36.0.0", note = "Use Self::UNIT")] fn get_time_unit() -> TimeUnit { Self::UNIT } diff --git a/arrow-buffer/src/buffer/boolean.rs b/arrow-buffer/src/buffer/boolean.rs index 49a75b468dbe..49b88d1f5812 100644 --- a/arrow-buffer/src/buffer/boolean.rs +++ b/arrow-buffer/src/buffer/boolean.rs @@ -102,7 +102,7 @@ impl BooleanBuffer { /// /// Panics if `i >= self.len()` #[inline] - #[deprecated(note = "use BooleanBuffer::value")] + #[deprecated(since = "36.0.0", note = "use BooleanBuffer::value")] pub fn is_set(&self, i: usize) -> bool { self.value(i) } diff --git a/arrow-buffer/src/buffer/immutable.rs b/arrow-buffer/src/buffer/immutable.rs index 7254313b7da5..c2d4d069c101 100644 --- a/arrow-buffer/src/buffer/immutable.rs +++ b/arrow-buffer/src/buffer/immutable.rs @@ -112,7 +112,7 @@ impl Buffer { /// /// This function is unsafe as there is no guarantee that the given pointer is valid for `len` /// bytes. If the `ptr` and `capacity` come from a `Buffer`, then this is guaranteed. - #[deprecated(note = "Use Buffer::from_vec")] + #[deprecated(since = "50.0.0", note = "Use Buffer::from_vec")] pub unsafe fn from_raw_parts(ptr: NonNull, len: usize, capacity: usize) -> Self { assert!(len <= capacity); let layout = Layout::from_size_align(capacity, ALIGNMENT).unwrap(); @@ -279,7 +279,7 @@ impl Buffer { } /// Returns the number of 1-bits in this buffer. - #[deprecated(note = "use count_set_bits_offset instead")] + #[deprecated(since = "27.0.0", note = "use count_set_bits_offset instead")] pub fn count_set_bits(&self) -> usize { let len_in_bits = self.len() * 8; // self.offset is already taken into consideration by the bit_chunks implementation diff --git a/arrow-buffer/src/buffer/mutable.rs b/arrow-buffer/src/buffer/mutable.rs index 75644c74fbcc..854ccee4d611 100644 --- a/arrow-buffer/src/buffer/mutable.rs +++ b/arrow-buffer/src/buffer/mutable.rs @@ -120,7 +120,7 @@ impl MutableBuffer { /// Create a [`MutableBuffer`] from the provided [`Vec`] without copying #[inline] - #[deprecated(note = "Use From>")] + #[deprecated(since = "46.0.0", note = "Use From>")] pub fn from_vec(vec: Vec) -> Self { Self::from(vec) } diff --git a/arrow-buffer/src/native.rs b/arrow-buffer/src/native.rs index c563f73cf5b9..fb19903f1286 100644 --- a/arrow-buffer/src/native.rs +++ b/arrow-buffer/src/native.rs @@ -92,7 +92,7 @@ pub trait ArrowNativeType: /// Convert native type from i32. /// /// Returns `None` if [`Self`] is not `i32` - #[deprecated(note = "please use `Option::Some` instead")] + #[deprecated(since = "24.0.0", note = "please use `Option::Some` instead")] fn from_i32(_: i32) -> Option { None } @@ -100,7 +100,7 @@ pub trait ArrowNativeType: /// Convert native type from i64. /// /// Returns `None` if [`Self`] is not `i64` - #[deprecated(note = "please use `Option::Some` instead")] + #[deprecated(since = "24.0.0", note = "please use `Option::Some` instead")] fn from_i64(_: i64) -> Option { None } @@ -108,7 +108,7 @@ pub trait ArrowNativeType: /// Convert native type from i128. /// /// Returns `None` if [`Self`] is not `i128` - #[deprecated(note = "please use `Option::Some` instead")] + #[deprecated(since = "24.0.0", note = "please use `Option::Some` instead")] fn from_i128(_: i128) -> Option { None } diff --git a/arrow-csv/src/reader/mod.rs b/arrow-csv/src/reader/mod.rs index c91b436f6cce..7c288d718e28 100644 --- a/arrow-csv/src/reader/mod.rs +++ b/arrow-csv/src/reader/mod.rs @@ -408,7 +408,7 @@ impl Format { /// reader cursor offset. /// /// The inferred schema will always have each field set as nullable. -#[deprecated(note = "Use Format::infer_schema")] +#[deprecated(since = "39.0.0", note = "Use Format::infer_schema")] #[allow(deprecated)] pub fn infer_file_schema( mut reader: R, @@ -429,7 +429,7 @@ pub fn infer_file_schema( /// not set, all records are read to infer the schema. /// /// Return inferred schema and number of records used for inference. -#[deprecated(note = "Use Format::infer_schema")] +#[deprecated(since = "39.0.0", note = "Use Format::infer_schema")] pub fn infer_reader_schema( reader: R, delimiter: u8, @@ -1102,7 +1102,7 @@ impl ReaderBuilder { } /// Set whether the CSV file has headers - #[deprecated(note = "Use with_header")] + #[deprecated(since = "39.0.0", note = "Use with_header")] #[doc(hidden)] pub fn has_header(mut self, has_header: bool) -> Self { self.format.header = has_header; diff --git a/arrow-csv/src/writer.rs b/arrow-csv/src/writer.rs index eae2133a4623..6fffe244d20d 100644 --- a/arrow-csv/src/writer.rs +++ b/arrow-csv/src/writer.rs @@ -257,7 +257,7 @@ impl WriterBuilder { } /// Set whether to write headers - #[deprecated(note = "Use Self::with_header")] + #[deprecated(since = "39.0.0", note = "Use Self::with_header")] #[doc(hidden)] pub fn has_headers(mut self, has_headers: bool) -> Self { self.has_header = has_headers; @@ -398,7 +398,7 @@ impl WriterBuilder { } /// Use RFC3339 format for date/time/timestamps (default) - #[deprecated(note = "Use WriterBuilder::default()")] + #[deprecated(since = "39.0.0", note = "Use WriterBuilder::default()")] pub fn with_rfc3339(mut self) -> Self { self.date_format = None; self.datetime_format = None; diff --git a/arrow-data/src/data.rs b/arrow-data/src/data.rs index 8af2a91cf159..cbdda9b6929e 100644 --- a/arrow-data/src/data.rs +++ b/arrow-data/src/data.rs @@ -32,7 +32,7 @@ use crate::{equal, validate_binary_view, validate_string_view}; /// A collection of [`Buffer`] #[doc(hidden)] -#[deprecated(note = "Use [Buffer]")] +#[deprecated(since = "46.0.0", note = "Use [Buffer]")] pub type Buffers<'a> = &'a [Buffer]; #[inline] diff --git a/arrow-json/src/reader/mod.rs b/arrow-json/src/reader/mod.rs index ba31b78570c6..c9013b10fb5f 100644 --- a/arrow-json/src/reader/mod.rs +++ b/arrow-json/src/reader/mod.rs @@ -246,7 +246,7 @@ impl ReaderBuilder { /// Sets if the decoder should coerce primitive values (bool and number) into string /// when the Schema's column is Utf8 or LargeUtf8. - #[deprecated(note = "Use with_coerce_primitive")] + #[deprecated(since = "39.0.0", note = "Use with_coerce_primitive")] pub fn coerce_primitive(self, coerce_primitive: bool) -> Self { self.with_coerce_primitive(coerce_primitive) } diff --git a/arrow-ord/src/cmp.rs b/arrow-ord/src/cmp.rs index f571e26c444c..2727ff996150 100644 --- a/arrow-ord/src/cmp.rs +++ b/arrow-ord/src/cmp.rs @@ -656,7 +656,10 @@ pub fn compare_byte_view( /// /// # Safety /// The left/right_idx must within range of each array -#[deprecated(note = "Use `GenericByteViewArray::compare_unchecked` instead")] +#[deprecated( + since = "52.2.0", + note = "Use `GenericByteViewArray::compare_unchecked` instead" +)] pub unsafe fn compare_byte_view_unchecked( left: &GenericByteViewArray, left_idx: usize, diff --git a/arrow-ord/src/ord.rs b/arrow-ord/src/ord.rs index 6430c8f0e405..db15d36d6eb7 100644 --- a/arrow-ord/src/ord.rs +++ b/arrow-ord/src/ord.rs @@ -265,7 +265,7 @@ fn compare_struct( Ok(f) } -#[deprecated(note = "Use make_comparator")] +#[deprecated(since = "52.0.0", note = "Use make_comparator")] #[doc(hidden)] pub fn build_compare(left: &dyn Array, right: &dyn Array) -> Result { make_comparator(left, right, SortOptions::default()) diff --git a/arrow-ord/src/partition.rs b/arrow-ord/src/partition.rs index 8c87eefadbf0..48cd95941297 100644 --- a/arrow-ord/src/partition.rs +++ b/arrow-ord/src/partition.rs @@ -167,7 +167,7 @@ fn find_boundaries(v: &dyn Array) -> Result { /// The returned vec would be of size k where k is cardinality of the sorted values; Consecutive /// values will be connected: (a, b) and (b, c), where start = 0 and end = n for the first and last /// range. -#[deprecated(note = "Use partition")] +#[deprecated(since = "46.0.0", note = "Use partition")] pub fn lexicographical_partition_ranges( columns: &[SortColumn], ) -> Result> + '_, ArrowError> { diff --git a/arrow-schema/src/fields.rs b/arrow-schema/src/fields.rs index 5b9ce2a6da61..33328268e6d6 100644 --- a/arrow-schema/src/fields.rs +++ b/arrow-schema/src/fields.rs @@ -275,7 +275,7 @@ impl Fields { /// assert_eq!(fields.remove(1), Field::new("b", DataType::Int8, false).into()); /// assert_eq!(fields.len(), 2); /// ``` - #[deprecated(note = "Use SchemaBuilder::remove")] + #[deprecated(since = "50.0.0", note = "Use SchemaBuilder::remove")] #[doc(hidden)] pub fn remove(&mut self, index: usize) -> FieldRef { let mut builder = SchemaBuilder::from(Fields::from(&*self.0)); diff --git a/arrow-schema/src/schema.rs b/arrow-schema/src/schema.rs index cc3a8a308a83..c5c22b527136 100644 --- a/arrow-schema/src/schema.rs +++ b/arrow-schema/src/schema.rs @@ -455,7 +455,7 @@ 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")] + #[deprecated(since = "50.0.0", note = "Use SchemaBuilder::remove")] #[doc(hidden)] #[allow(deprecated)] pub fn remove(&mut self, index: usize) -> FieldRef { diff --git a/object_store/src/memory.rs b/object_store/src/memory.rs index b458bdddfbf5..4584ab7feadd 100644 --- a/object_store/src/memory.rs +++ b/object_store/src/memory.rs @@ -469,7 +469,7 @@ impl InMemory { } /// Creates a clone of the store - #[deprecated(note = "Use fork() instead")] + #[deprecated(since = "44.0.0", note = "Use fork() instead")] pub async fn clone(&self) -> Self { self.fork() } diff --git a/object_store/src/prefix.rs b/object_store/src/prefix.rs index 9b10fea5e0bb..8e52d1f98851 100644 --- a/object_store/src/prefix.rs +++ b/object_store/src/prefix.rs @@ -27,7 +27,7 @@ use crate::{ }; #[doc(hidden)] -#[deprecated(note = "Use PrefixStore")] +#[deprecated(since = "36.0.0", note = "Use PrefixStore")] pub type PrefixObjectStore = PrefixStore; /// Store wrapper that applies a constant prefix to all paths handled by the store. diff --git a/parquet/src/basic.rs b/parquet/src/basic.rs index 1926b87623bf..97e8c22f1b2f 100644 --- a/parquet/src/basic.rs +++ b/parquet/src/basic.rs @@ -302,6 +302,7 @@ pub enum Encoding { /// /// The RLE/bit-packing hybrid is more cpu and memory efficient and should be used instead. #[deprecated( + since = "51.0.0", note = "Please see documentation for compatibility issues and use the RLE/bit-packing hybrid encoding instead" )] BIT_PACKED, diff --git a/parquet/src/column/reader.rs b/parquet/src/column/reader.rs index 2b43b4c3e45c..d95b10f30c3d 100644 --- a/parquet/src/column/reader.rs +++ b/parquet/src/column/reader.rs @@ -197,7 +197,7 @@ where /// /// `values` will be contiguously populated with the non-null values. Note that if the column /// is not required, this may be less than either `batch_size` or the number of levels read - #[deprecated(note = "Use read_records")] + #[deprecated(since = "42.0.0", note = "Use read_records")] pub fn read_batch( &mut self, batch_size: usize, diff --git a/parquet/src/file/metadata/mod.rs b/parquet/src/file/metadata/mod.rs index 32b985710023..642706f554f2 100644 --- a/parquet/src/file/metadata/mod.rs +++ b/parquet/src/file/metadata/mod.rs @@ -190,7 +190,7 @@ impl ParquetMetaData { /// Creates Parquet metadata from file metadata, a list of row /// group metadata, and the column index structures. - #[deprecated(note = "Use ParquetMetaDataBuilder")] + #[deprecated(since = "53.1.0", note = "Use ParquetMetaDataBuilder")] pub fn new_with_page_index( file_metadata: FileMetaData, row_groups: Vec, @@ -231,7 +231,7 @@ impl ParquetMetaData { } /// Returns page indexes in this file. - #[deprecated(note = "Use Self::column_index")] + #[deprecated(since = "39.0.0", note = "Use Self::column_index")] pub fn page_indexes(&self) -> Option<&ParquetColumnIndex> { self.column_index.as_ref() } @@ -247,7 +247,7 @@ impl ParquetMetaData { } /// Returns the offset index for this file if loaded - #[deprecated(note = "Use Self::offset_index")] + #[deprecated(since = "39.0.0", note = "Use Self::offset_index")] pub fn offset_indexes(&self) -> Option<&ParquetOffsetIndex> { self.offset_index.as_ref() }