Skip to content

Commit f033e4f

Browse files
authored
Add version to deprecation messages (apache#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,

0 commit comments

Comments
 (0)