Skip to content

Commit f033e4f

Browse files
authored
Add version to deprecation messages (#6782)
Version is inferred from first release tag containing the commit that added the deprecation.
1 parent 9705563 commit f033e4f

File tree

29 files changed

+49
-38
lines changed

29 files changed

+49
-38
lines changed

arrow-arith/src/arity.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ where
104104
}
105105

106106
/// Applies an infallible unary function to an array with primitive values.
107-
#[deprecated(note = "Use arrow_array::AnyDictionaryArray")]
107+
#[deprecated(since = "46.0.0", note = "Use arrow_array::AnyDictionaryArray")]
108108
pub fn unary_dyn<F, T>(array: &dyn Array, op: F) -> Result<ArrayRef, ArrowError>
109109
where
110110
T: ArrowPrimitiveType,
@@ -130,7 +130,7 @@ where
130130
}
131131

132132
/// Applies a fallible unary function to an array with primitive values.
133-
#[deprecated(note = "Use arrow_array::AnyDictionaryArray")]
133+
#[deprecated(since = "46.0.0", note = "Use arrow_array::AnyDictionaryArray")]
134134
pub fn try_unary_dyn<F, T>(array: &dyn Array, op: F) -> Result<ArrayRef, ArrowError>
135135
where
136136
T: ArrowPrimitiveType,

arrow-arith/src/temporal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ impl<T: Datelike> ChronoDateExt for T {
669669
///
670670
/// Note that the offset is function of time and can vary depending on whether daylight savings is
671671
/// in effect or not. e.g. Australia/Sydney is +10:00 or +11:00 depending on DST.
672-
#[deprecated(note = "Use arrow_array::timezone::Tz instead")]
672+
#[deprecated(since = "26.0.0", note = "Use arrow_array::timezone::Tz instead")]
673673
pub fn using_chrono_tz_and_utc_naive_date_time(
674674
tz: &str,
675675
utc: NaiveDateTime,

arrow-array/src/array/binary_array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub type GenericBinaryArray<OffsetSize> = GenericByteArray<GenericBinaryType<Off
2525

2626
impl<OffsetSize: OffsetSizeTrait> GenericBinaryArray<OffsetSize> {
2727
/// Get the data type of the array.
28-
#[deprecated(note = "please use `Self::DATA_TYPE` instead")]
28+
#[deprecated(since = "20.0.0", note = "please use `Self::DATA_TYPE` instead")]
2929
pub const fn get_data_type() -> DataType {
3030
Self::DATA_TYPE
3131
}

arrow-array/src/array/fixed_size_binary_array.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ impl FixedSizeBinaryArray {
237237
///
238238
/// Returns error if argument has length zero, or sizes of nested slices don't match.
239239
#[deprecated(
240+
since = "28.0.0",
240241
note = "This function will fail if the iterator produces only None values; prefer `try_from_sparse_iter_with_size`"
241242
)]
242243
pub fn try_from_sparse_iter<T, U>(mut iter: T) -> Result<Self, ArrowError>

arrow-array/src/array/primitive_array.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,7 +1481,7 @@ def_numeric_from_vec!(TimestampNanosecondType);
14811481

14821482
impl<T: ArrowTimestampType> PrimitiveArray<T> {
14831483
/// Construct a timestamp array from a vec of i64 values and an optional timezone
1484-
#[deprecated(note = "Use with_timezone_opt instead")]
1484+
#[deprecated(since = "26.0.0", note = "Use with_timezone_opt instead")]
14851485
pub fn from_vec(data: Vec<i64>, timezone: Option<String>) -> Self
14861486
where
14871487
Self: From<Vec<i64>>,
@@ -1490,7 +1490,7 @@ impl<T: ArrowTimestampType> PrimitiveArray<T> {
14901490
}
14911491

14921492
/// Construct a timestamp array from a vec of `Option<i64>` values and an optional timezone
1493-
#[deprecated(note = "Use with_timezone_opt instead")]
1493+
#[deprecated(since = "26.0.0", note = "Use with_timezone_opt instead")]
14941494
pub fn from_opt_vec(data: Vec<Option<i64>>, timezone: Option<String>) -> Self
14951495
where
14961496
Self: From<Vec<Option<i64>>>,

arrow-array/src/array/string_array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub type GenericStringArray<OffsetSize> = GenericByteArray<GenericStringType<Off
2424

2525
impl<OffsetSize: OffsetSizeTrait> GenericStringArray<OffsetSize> {
2626
/// Get the data type of the array.
27-
#[deprecated(note = "please use `Self::DATA_TYPE` instead")]
27+
#[deprecated(since = "20.0.0", note = "please use `Self::DATA_TYPE` instead")]
2828
pub const fn get_data_type() -> DataType {
2929
Self::DATA_TYPE
3030
}

arrow-array/src/builder/generic_bytes_view_builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ impl<T: ByteViewType + ?Sized> GenericByteViewBuilder<T> {
136136

137137
/// Override the size of buffers to allocate for holding string data
138138
/// Use `with_fixed_block_size` instead.
139-
#[deprecated(note = "Use `with_fixed_block_size` instead")]
139+
#[deprecated(since = "53.0.0", note = "Use `with_fixed_block_size` instead")]
140140
pub fn with_block_size(self, block_size: u32) -> Self {
141141
self.with_fixed_block_size(block_size)
142142
}

arrow-array/src/cast.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,10 @@ array_downcast_fn!(as_union_array, UnionArray);
690690
array_downcast_fn!(as_map_array, MapArray);
691691

692692
/// Force downcast of an Array, such as an ArrayRef to Decimal128Array, panic’ing on failure.
693-
#[deprecated(note = "please use `as_primitive_array::<Decimal128Type>` instead")]
693+
#[deprecated(
694+
since = "42.0.0",
695+
note = "please use `as_primitive_array::<Decimal128Type>` instead"
696+
)]
694697
pub fn as_decimal_array(arr: &dyn Array) -> &PrimitiveArray<Decimal128Type> {
695698
as_primitive_array::<Decimal128Type>(arr)
696699
}

arrow-array/src/ffi.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,10 @@ type Result<T> = std::result::Result<T, ArrowError>;
121121
/// This function copies the content of two FFI structs [arrow_data::ffi::FFI_ArrowArray] and
122122
/// [arrow_schema::ffi::FFI_ArrowSchema] in the array to the location pointed by the raw pointers.
123123
/// Usually the raw pointers are provided by the array data consumer.
124-
#[deprecated(note = "Use FFI_ArrowArray::new and FFI_ArrowSchema::try_from")]
124+
#[deprecated(
125+
since = "52.0.0",
126+
note = "Use FFI_ArrowArray::new and FFI_ArrowSchema::try_from"
127+
)]
125128
pub unsafe fn export_array_into_raw(
126129
src: ArrayRef,
127130
out_array: *mut FFI_ArrowArray,

arrow-array/src/ffi_stream.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ impl RecordBatchReader for ArrowArrayStreamReader {
384384
/// # Safety
385385
/// Assumes that the pointer represents valid C Stream Interfaces, both in memory
386386
/// representation and lifetime via the `release` mechanism.
387-
#[deprecated(note = "Use FFI_ArrowArrayStream::new")]
387+
#[deprecated(since = "50.0.0", note = "Use FFI_ArrowArrayStream::new")]
388388
pub unsafe fn export_reader_into_raw(
389389
reader: Box<dyn RecordBatchReader + Send>,
390390
out_stream: *mut FFI_ArrowArrayStream,

arrow-array/src/types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub trait ArrowPrimitiveType: primitive::PrimitiveTypeSealed + 'static {
6969
const DATA_TYPE: DataType;
7070

7171
/// Returns the byte width of this primitive type.
72-
#[deprecated(note = "Use ArrowNativeType::get_byte_width")]
72+
#[deprecated(since = "52.0.0", note = "Use ArrowNativeType::get_byte_width")]
7373
fn get_byte_width() -> usize {
7474
std::mem::size_of::<Self::Native>()
7575
}
@@ -325,7 +325,7 @@ pub trait ArrowTimestampType: ArrowTemporalType<Native = i64> {
325325
const UNIT: TimeUnit;
326326

327327
/// Returns the `TimeUnit` of this timestamp.
328-
#[deprecated(note = "Use Self::UNIT")]
328+
#[deprecated(since = "36.0.0", note = "Use Self::UNIT")]
329329
fn get_time_unit() -> TimeUnit {
330330
Self::UNIT
331331
}

arrow-buffer/src/buffer/boolean.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ impl BooleanBuffer {
102102
///
103103
/// Panics if `i >= self.len()`
104104
#[inline]
105-
#[deprecated(note = "use BooleanBuffer::value")]
105+
#[deprecated(since = "36.0.0", note = "use BooleanBuffer::value")]
106106
pub fn is_set(&self, i: usize) -> bool {
107107
self.value(i)
108108
}

arrow-buffer/src/buffer/immutable.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ impl Buffer {
112112
///
113113
/// This function is unsafe as there is no guarantee that the given pointer is valid for `len`
114114
/// bytes. If the `ptr` and `capacity` come from a `Buffer`, then this is guaranteed.
115-
#[deprecated(note = "Use Buffer::from_vec")]
115+
#[deprecated(since = "50.0.0", note = "Use Buffer::from_vec")]
116116
pub unsafe fn from_raw_parts(ptr: NonNull<u8>, len: usize, capacity: usize) -> Self {
117117
assert!(len <= capacity);
118118
let layout = Layout::from_size_align(capacity, ALIGNMENT).unwrap();
@@ -279,7 +279,7 @@ impl Buffer {
279279
}
280280

281281
/// Returns the number of 1-bits in this buffer.
282-
#[deprecated(note = "use count_set_bits_offset instead")]
282+
#[deprecated(since = "27.0.0", note = "use count_set_bits_offset instead")]
283283
pub fn count_set_bits(&self) -> usize {
284284
let len_in_bits = self.len() * 8;
285285
// self.offset is already taken into consideration by the bit_chunks implementation

arrow-buffer/src/buffer/mutable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl MutableBuffer {
120120

121121
/// Create a [`MutableBuffer`] from the provided [`Vec`] without copying
122122
#[inline]
123-
#[deprecated(note = "Use From<Vec<T>>")]
123+
#[deprecated(since = "46.0.0", note = "Use From<Vec<T>>")]
124124
pub fn from_vec<T: ArrowNativeType>(vec: Vec<T>) -> Self {
125125
Self::from(vec)
126126
}

arrow-buffer/src/native.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,23 +92,23 @@ pub trait ArrowNativeType:
9292
/// Convert native type from i32.
9393
///
9494
/// Returns `None` if [`Self`] is not `i32`
95-
#[deprecated(note = "please use `Option::Some` instead")]
95+
#[deprecated(since = "24.0.0", note = "please use `Option::Some` instead")]
9696
fn from_i32(_: i32) -> Option<Self> {
9797
None
9898
}
9999

100100
/// Convert native type from i64.
101101
///
102102
/// Returns `None` if [`Self`] is not `i64`
103-
#[deprecated(note = "please use `Option::Some` instead")]
103+
#[deprecated(since = "24.0.0", note = "please use `Option::Some` instead")]
104104
fn from_i64(_: i64) -> Option<Self> {
105105
None
106106
}
107107

108108
/// Convert native type from i128.
109109
///
110110
/// Returns `None` if [`Self`] is not `i128`
111-
#[deprecated(note = "please use `Option::Some` instead")]
111+
#[deprecated(since = "24.0.0", note = "please use `Option::Some` instead")]
112112
fn from_i128(_: i128) -> Option<Self> {
113113
None
114114
}

arrow-csv/src/reader/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ impl Format {
408408
/// reader cursor offset.
409409
///
410410
/// The inferred schema will always have each field set as nullable.
411-
#[deprecated(note = "Use Format::infer_schema")]
411+
#[deprecated(since = "39.0.0", note = "Use Format::infer_schema")]
412412
#[allow(deprecated)]
413413
pub fn infer_file_schema<R: Read + Seek>(
414414
mut reader: R,
@@ -429,7 +429,7 @@ pub fn infer_file_schema<R: Read + Seek>(
429429
/// not set, all records are read to infer the schema.
430430
///
431431
/// Return inferred schema and number of records used for inference.
432-
#[deprecated(note = "Use Format::infer_schema")]
432+
#[deprecated(since = "39.0.0", note = "Use Format::infer_schema")]
433433
pub fn infer_reader_schema<R: Read>(
434434
reader: R,
435435
delimiter: u8,
@@ -1102,7 +1102,7 @@ impl ReaderBuilder {
11021102
}
11031103

11041104
/// Set whether the CSV file has headers
1105-
#[deprecated(note = "Use with_header")]
1105+
#[deprecated(since = "39.0.0", note = "Use with_header")]
11061106
#[doc(hidden)]
11071107
pub fn has_header(mut self, has_header: bool) -> Self {
11081108
self.format.header = has_header;

arrow-csv/src/writer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ impl WriterBuilder {
257257
}
258258

259259
/// Set whether to write headers
260-
#[deprecated(note = "Use Self::with_header")]
260+
#[deprecated(since = "39.0.0", note = "Use Self::with_header")]
261261
#[doc(hidden)]
262262
pub fn has_headers(mut self, has_headers: bool) -> Self {
263263
self.has_header = has_headers;
@@ -398,7 +398,7 @@ impl WriterBuilder {
398398
}
399399

400400
/// Use RFC3339 format for date/time/timestamps (default)
401-
#[deprecated(note = "Use WriterBuilder::default()")]
401+
#[deprecated(since = "39.0.0", note = "Use WriterBuilder::default()")]
402402
pub fn with_rfc3339(mut self) -> Self {
403403
self.date_format = None;
404404
self.datetime_format = None;

arrow-data/src/data.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use crate::{equal, validate_binary_view, validate_string_view};
3232

3333
/// A collection of [`Buffer`]
3434
#[doc(hidden)]
35-
#[deprecated(note = "Use [Buffer]")]
35+
#[deprecated(since = "46.0.0", note = "Use [Buffer]")]
3636
pub type Buffers<'a> = &'a [Buffer];
3737

3838
#[inline]

arrow-json/src/reader/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ impl ReaderBuilder {
246246

247247
/// Sets if the decoder should coerce primitive values (bool and number) into string
248248
/// when the Schema's column is Utf8 or LargeUtf8.
249-
#[deprecated(note = "Use with_coerce_primitive")]
249+
#[deprecated(since = "39.0.0", note = "Use with_coerce_primitive")]
250250
pub fn coerce_primitive(self, coerce_primitive: bool) -> Self {
251251
self.with_coerce_primitive(coerce_primitive)
252252
}

arrow-ord/src/cmp.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,10 @@ pub fn compare_byte_view<T: ByteViewType>(
656656
///
657657
/// # Safety
658658
/// The left/right_idx must within range of each array
659-
#[deprecated(note = "Use `GenericByteViewArray::compare_unchecked` instead")]
659+
#[deprecated(
660+
since = "52.2.0",
661+
note = "Use `GenericByteViewArray::compare_unchecked` instead"
662+
)]
660663
pub unsafe fn compare_byte_view_unchecked<T: ByteViewType>(
661664
left: &GenericByteViewArray<T>,
662665
left_idx: usize,

arrow-ord/src/ord.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ fn compare_struct(
265265
Ok(f)
266266
}
267267

268-
#[deprecated(note = "Use make_comparator")]
268+
#[deprecated(since = "52.0.0", note = "Use make_comparator")]
269269
#[doc(hidden)]
270270
pub fn build_compare(left: &dyn Array, right: &dyn Array) -> Result<DynComparator, ArrowError> {
271271
make_comparator(left, right, SortOptions::default())

arrow-ord/src/partition.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ fn find_boundaries(v: &dyn Array) -> Result<BooleanBuffer, ArrowError> {
167167
/// The returned vec would be of size k where k is cardinality of the sorted values; Consecutive
168168
/// values will be connected: (a, b) and (b, c), where start = 0 and end = n for the first and last
169169
/// range.
170-
#[deprecated(note = "Use partition")]
170+
#[deprecated(since = "46.0.0", note = "Use partition")]
171171
pub fn lexicographical_partition_ranges(
172172
columns: &[SortColumn],
173173
) -> Result<impl Iterator<Item = Range<usize>> + '_, ArrowError> {

arrow-schema/src/fields.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ impl Fields {
275275
/// assert_eq!(fields.remove(1), Field::new("b", DataType::Int8, false).into());
276276
/// assert_eq!(fields.len(), 2);
277277
/// ```
278-
#[deprecated(note = "Use SchemaBuilder::remove")]
278+
#[deprecated(since = "50.0.0", note = "Use SchemaBuilder::remove")]
279279
#[doc(hidden)]
280280
pub fn remove(&mut self, index: usize) -> FieldRef {
281281
let mut builder = SchemaBuilder::from(Fields::from(&*self.0));

arrow-schema/src/schema.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ impl Schema {
455455
/// assert_eq!(schema.remove(1), Field::new("b", DataType::Int8, false).into());
456456
/// assert_eq!(schema.fields.len(), 2);
457457
/// ```
458-
#[deprecated(note = "Use SchemaBuilder::remove")]
458+
#[deprecated(since = "50.0.0", note = "Use SchemaBuilder::remove")]
459459
#[doc(hidden)]
460460
#[allow(deprecated)]
461461
pub fn remove(&mut self, index: usize) -> FieldRef {

object_store/src/memory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ impl InMemory {
469469
}
470470

471471
/// Creates a clone of the store
472-
#[deprecated(note = "Use fork() instead")]
472+
#[deprecated(since = "44.0.0", note = "Use fork() instead")]
473473
pub async fn clone(&self) -> Self {
474474
self.fork()
475475
}

object_store/src/prefix.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use crate::{
2727
};
2828

2929
#[doc(hidden)]
30-
#[deprecated(note = "Use PrefixStore")]
30+
#[deprecated(since = "36.0.0", note = "Use PrefixStore")]
3131
pub type PrefixObjectStore<T> = PrefixStore<T>;
3232

3333
/// Store wrapper that applies a constant prefix to all paths handled by the store.

parquet/src/basic.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ pub enum Encoding {
302302
///
303303
/// The RLE/bit-packing hybrid is more cpu and memory efficient and should be used instead.
304304
#[deprecated(
305+
since = "51.0.0",
305306
note = "Please see documentation for compatibility issues and use the RLE/bit-packing hybrid encoding instead"
306307
)]
307308
BIT_PACKED,

parquet/src/column/reader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ where
197197
///
198198
/// `values` will be contiguously populated with the non-null values. Note that if the column
199199
/// is not required, this may be less than either `batch_size` or the number of levels read
200-
#[deprecated(note = "Use read_records")]
200+
#[deprecated(since = "42.0.0", note = "Use read_records")]
201201
pub fn read_batch(
202202
&mut self,
203203
batch_size: usize,

parquet/src/file/metadata/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ impl ParquetMetaData {
190190

191191
/// Creates Parquet metadata from file metadata, a list of row
192192
/// group metadata, and the column index structures.
193-
#[deprecated(note = "Use ParquetMetaDataBuilder")]
193+
#[deprecated(since = "53.1.0", note = "Use ParquetMetaDataBuilder")]
194194
pub fn new_with_page_index(
195195
file_metadata: FileMetaData,
196196
row_groups: Vec<RowGroupMetaData>,
@@ -231,7 +231,7 @@ impl ParquetMetaData {
231231
}
232232

233233
/// Returns page indexes in this file.
234-
#[deprecated(note = "Use Self::column_index")]
234+
#[deprecated(since = "39.0.0", note = "Use Self::column_index")]
235235
pub fn page_indexes(&self) -> Option<&ParquetColumnIndex> {
236236
self.column_index.as_ref()
237237
}
@@ -247,7 +247,7 @@ impl ParquetMetaData {
247247
}
248248

249249
/// Returns the offset index for this file if loaded
250-
#[deprecated(note = "Use Self::offset_index")]
250+
#[deprecated(since = "39.0.0", note = "Use Self::offset_index")]
251251
pub fn offset_indexes(&self) -> Option<&ParquetOffsetIndex> {
252252
self.offset_index.as_ref()
253253
}

0 commit comments

Comments
 (0)