Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions arrow-array/src/temporal_conversions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,26 +215,12 @@ pub(crate) fn split_second(v: i64, base: i64) -> (i64, u32) {
(v.div_euclid(base), v.rem_euclid(base) as u32)
}

/// converts a `i64` representing a `duration(s)` to [`Duration`]
#[inline]
#[deprecated(since = "55.2.0", note = "Use `try_duration_s_to_duration` instead")]
pub fn duration_s_to_duration(v: i64) -> Duration {
Duration::try_seconds(v).unwrap()
}

/// converts a `i64` representing a `duration(s)` to [`Option<Duration>`]
#[inline]
pub fn try_duration_s_to_duration(v: i64) -> Option<Duration> {
Duration::try_seconds(v)
}

/// converts a `i64` representing a `duration(ms)` to [`Duration`]
#[inline]
#[deprecated(since = "55.2.0", note = "Use `try_duration_ms_to_duration` instead")]
pub fn duration_ms_to_duration(v: i64) -> Duration {
Duration::try_seconds(v).unwrap()
}

/// converts a `i64` representing a `duration(ms)` to [`Option<Duration>`]
#[inline]
pub fn try_duration_ms_to_duration(v: i64) -> Option<Duration> {
Expand Down
127 changes: 0 additions & 127 deletions arrow-array/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1205,17 +1205,6 @@ impl Date32Type {
}

impl Date64Type {
/// Converts an arrow Date64Type into a chrono::NaiveDate
///
/// # Arguments
///
/// * `i` - The Date64Type to convert
#[deprecated(since = "56.0.0", note = "Use to_naive_date_opt instead.")]
pub fn to_naive_date(i: <Date64Type as ArrowPrimitiveType>::Native) -> NaiveDate {
Self::to_naive_date_opt(i)
.unwrap_or_else(|| panic!("Date64Type::to_naive_date overflowed for date: {i}",))
}

/// Converts an arrow Date64Type into a chrono::NaiveDateTime if it fits in the range that chrono::NaiveDateTime can represent.
/// Returns `None` if the calculation would overflow or underflow.
///
Expand All @@ -1241,25 +1230,6 @@ impl Date64Type {
d.sub(epoch).num_milliseconds() as <Date64Type as ArrowPrimitiveType>::Native
}

/// Adds the given IntervalYearMonthType to an arrow Date64Type
///
/// # Arguments
///
/// * `date` - The date on which to perform the operation
/// * `delta` - The interval to add
#[deprecated(
since = "56.0.0",
note = "Use `add_year_months_opt` instead, which returns an Option to handle overflow."
)]
pub fn add_year_months(
date: <Date64Type as ArrowPrimitiveType>::Native,
delta: <IntervalYearMonthType as ArrowPrimitiveType>::Native,
) -> <Date64Type as ArrowPrimitiveType>::Native {
Self::add_year_months_opt(date, delta).unwrap_or_else(|| {
panic!("Date64Type::add_year_months overflowed for date: {date}, delta: {delta}",)
})
}

/// Adds the given IntervalYearMonthType to an arrow Date64Type
///
/// # Arguments
Expand All @@ -1278,25 +1248,6 @@ impl Date64Type {
Some(Date64Type::from_naive_date(posterior))
}

/// Adds the given IntervalDayTimeType to an arrow Date64Type
///
/// # Arguments
///
/// * `date` - The date on which to perform the operation
/// * `delta` - The interval to add
#[deprecated(
since = "56.0.0",
note = "Use `add_day_time_opt` instead, which returns an Option to handle overflow."
)]
pub fn add_day_time(
date: <Date64Type as ArrowPrimitiveType>::Native,
delta: <IntervalDayTimeType as ArrowPrimitiveType>::Native,
) -> <Date64Type as ArrowPrimitiveType>::Native {
Self::add_day_time_opt(date, delta).unwrap_or_else(|| {
panic!("Date64Type::add_day_time overflowed for date: {date}, delta: {delta:?}",)
})
}

/// Adds the given IntervalDayTimeType to an arrow Date64Type
///
/// # Arguments
Expand All @@ -1316,25 +1267,6 @@ impl Date64Type {
Some(Date64Type::from_naive_date(res))
}

/// Adds the given IntervalMonthDayNanoType to an arrow Date64Type
///
/// # Arguments
///
/// * `date` - The date on which to perform the operation
/// * `delta` - The interval to add
#[deprecated(
since = "56.0.0",
note = "Use `add_month_day_nano_opt` instead, which returns an Option to handle overflow."
)]
pub fn add_month_day_nano(
date: <Date64Type as ArrowPrimitiveType>::Native,
delta: <IntervalMonthDayNanoType as ArrowPrimitiveType>::Native,
) -> <Date64Type as ArrowPrimitiveType>::Native {
Self::add_month_day_nano_opt(date, delta).unwrap_or_else(|| {
panic!("Date64Type::add_month_day_nano overflowed for date: {date}, delta: {delta:?}",)
})
}

/// Adds the given IntervalMonthDayNanoType to an arrow Date64Type
///
/// # Arguments
Expand All @@ -1355,25 +1287,6 @@ impl Date64Type {
Some(Date64Type::from_naive_date(res))
}

/// Subtract the given IntervalYearMonthType to an arrow Date64Type
///
/// # Arguments
///
/// * `date` - The date on which to perform the operation
/// * `delta` - The interval to subtract
#[deprecated(
since = "56.0.0",
note = "Use `subtract_year_months_opt` instead, which returns an Option to handle overflow."
)]
pub fn subtract_year_months(
date: <Date64Type as ArrowPrimitiveType>::Native,
delta: <IntervalYearMonthType as ArrowPrimitiveType>::Native,
) -> <Date64Type as ArrowPrimitiveType>::Native {
Self::subtract_year_months_opt(date, delta).unwrap_or_else(|| {
panic!("Date64Type::subtract_year_months overflowed for date: {date}, delta: {delta}",)
})
}

/// Subtract the given IntervalYearMonthType to an arrow Date64Type
///
/// # Arguments
Expand All @@ -1392,25 +1305,6 @@ impl Date64Type {
Some(Date64Type::from_naive_date(posterior))
}

/// Subtract the given IntervalDayTimeType to an arrow Date64Type
///
/// # Arguments
///
/// * `date` - The date on which to perform the operation
/// * `delta` - The interval to subtract
#[deprecated(
since = "56.0.0",
note = "Use `subtract_day_time_opt` instead, which returns an Option to handle overflow."
)]
pub fn subtract_day_time(
date: <Date64Type as ArrowPrimitiveType>::Native,
delta: <IntervalDayTimeType as ArrowPrimitiveType>::Native,
) -> <Date64Type as ArrowPrimitiveType>::Native {
Self::subtract_day_time_opt(date, delta).unwrap_or_else(|| {
panic!("Date64Type::subtract_day_time overflowed for date: {date}, delta: {delta:?}",)
})
}

/// Subtract the given IntervalDayTimeType to an arrow Date64Type
///
/// # Arguments
Expand All @@ -1430,27 +1324,6 @@ impl Date64Type {
Some(Date64Type::from_naive_date(res))
}

/// Subtract the given IntervalMonthDayNanoType to an arrow Date64Type
///
/// # Arguments
///
/// * `date` - The date on which to perform the operation
/// * `delta` - The interval to subtract
#[deprecated(
since = "56.0.0",
note = "Use `subtract_month_day_nano_opt` instead, which returns an Option to handle overflow."
)]
pub fn subtract_month_day_nano(
date: <Date64Type as ArrowPrimitiveType>::Native,
delta: <IntervalMonthDayNanoType as ArrowPrimitiveType>::Native,
) -> <Date64Type as ArrowPrimitiveType>::Native {
Self::subtract_month_day_nano_opt(date, delta).unwrap_or_else(|| {
panic!(
"Date64Type::subtract_month_day_nano overflowed for date: {date}, delta: {delta:?}",
)
})
}

/// Subtract the given IntervalMonthDayNanoType to an arrow Date64Type
///
/// # Arguments
Expand Down
11 changes: 0 additions & 11 deletions arrow-buffer/src/buffer/immutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,6 @@ unsafe impl Send for Buffer where Bytes: Send {}
unsafe impl Sync for Buffer where Bytes: Sync {}

impl Buffer {
/// Create a new Buffer from a (internal) `Bytes`
///
/// NOTE despite the same name, `Bytes` is an internal struct in arrow-rs
/// and is different than [`bytes::Bytes`].
///
/// See examples on [`Buffer`] for ways to create a buffer from a [`bytes::Bytes`].
#[deprecated(since = "54.1.0", note = "Use Buffer::from instead")]
pub fn from_bytes(bytes: Bytes) -> Self {
Self::from(bytes)
}

/// Returns the offset, in bytes, of `Self::ptr` to `Self::data`
///
/// self.ptr and self.data can be different after slicing or advancing the buffer.
Expand Down
6 changes: 0 additions & 6 deletions arrow-data/src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2210,12 +2210,6 @@ impl ArrayDataBuilder {
Ok(data)
}

/// Creates an array data, validating all inputs, and aligning any buffers
#[deprecated(since = "54.1.0", note = "Use ArrayData::align_buffers instead")]
pub fn build_aligned(self) -> Result<ArrayData, ArrowError> {
self.align_buffers(true).build()
}

/// Ensure that all buffers are aligned, copying data if necessary
///
/// Rust requires that arrays are aligned to their corresponding primitive,
Expand Down
100 changes: 0 additions & 100 deletions arrow-data/src/decimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -688,106 +688,6 @@ pub const MIN_DECIMAL256_FOR_EACH_PRECISION: [i256; 77] = [
]),
];

/// `MAX_DECIMAL_FOR_EACH_PRECISION[p-1]` holds the maximum `i128` value that can
/// be stored in a [`Decimal128`] value of precision `p`
///
/// [`Decimal128`]: arrow_schema::DataType::Decimal128
#[deprecated(
since = "54.1.0",
note = "Use MAX_DECIMAL128_FOR_EACH_PRECISION (note indexes are different)"
)]
#[allow(dead_code)] // no longer used but is part of our public API
pub const MAX_DECIMAL_FOR_EACH_PRECISION: [i128; 38] = [
9,
99,
999,
9999,
99999,
999999,
9999999,
99999999,
999999999,
9999999999,
99999999999,
999999999999,
9999999999999,
99999999999999,
999999999999999,
9999999999999999,
99999999999999999,
999999999999999999,
9999999999999999999,
99999999999999999999,
999999999999999999999,
9999999999999999999999,
99999999999999999999999,
999999999999999999999999,
9999999999999999999999999,
99999999999999999999999999,
999999999999999999999999999,
9999999999999999999999999999,
99999999999999999999999999999,
999999999999999999999999999999,
9999999999999999999999999999999,
99999999999999999999999999999999,
999999999999999999999999999999999,
9999999999999999999999999999999999,
99999999999999999999999999999999999,
999999999999999999999999999999999999,
9999999999999999999999999999999999999,
99999999999999999999999999999999999999,
];

/// `MIN_DECIMAL_FOR_EACH_PRECISION[p-1]` holds the minimum `i128` value that can
/// be stored in a [`Decimal128`] value of precision `p`
///
/// [`Decimal128`]: arrow_schema::DataType::Decimal128
#[allow(dead_code)] // no longer used but is part of our public API
#[deprecated(
since = "54.1.0",
note = "Use MIN_DECIMAL128_FOR_EACH_PRECISION (note indexes are different)"
)]
pub const MIN_DECIMAL_FOR_EACH_PRECISION: [i128; 38] = [
-9,
-99,
-999,
-9999,
-99999,
-999999,
-9999999,
-99999999,
-999999999,
-9999999999,
-99999999999,
-999999999999,
-9999999999999,
-99999999999999,
-999999999999999,
-9999999999999999,
-99999999999999999,
-999999999999999999,
-9999999999999999999,
-99999999999999999999,
-999999999999999999999,
-9999999999999999999999,
-99999999999999999999999,
-999999999999999999999999,
-9999999999999999999999999,
-99999999999999999999999999,
-999999999999999999999999999,
-9999999999999999999999999999,
-99999999999999999999999999999,
-999999999999999999999999999999,
-9999999999999999999999999999999,
-99999999999999999999999999999999,
-999999999999999999999999999999999,
-9999999999999999999999999999999999,
-99999999999999999999999999999999999,
-999999999999999999999999999999999999,
-9999999999999999999999999999999999999,
-99999999999999999999999999999999999999,
];

/// `MAX_DECIMAL128_FOR_EACH_PRECISION[p]` holds the maximum `i128` value that can
/// be stored in [`Decimal128`] value of precision `p`.
///
Expand Down
4 changes: 2 additions & 2 deletions arrow-ipc/src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ impl<'a> RecordBatchDecoder<'a> {
/// If `require_alignment` is false, this function will automatically allocate a new aligned buffer
/// and copy over the data if any array data in the input `buf` is not properly aligned.
/// (Properly aligned array data will remain zero-copy.)
/// Under the hood it will use [`arrow_data::ArrayDataBuilder::build_aligned`] to construct [`arrow_data::ArrayData`].
/// Under the hood it will use [`arrow_data::ArrayDataBuilder::align_buffers`] to construct [`arrow_data::ArrayData`].
pub fn read_record_batch(
buf: &Buffer,
batch: crate::RecordBatch,
Expand Down Expand Up @@ -1046,7 +1046,7 @@ impl FileDecoder {
/// If `require_alignment` is false (the default), this decoder will automatically allocate a
/// new aligned buffer and copy over the data if any array data in the input `buf` is not
/// properly aligned. (Properly aligned array data will remain zero-copy.)
/// Under the hood it will use [`arrow_data::ArrayDataBuilder::build_aligned`] to construct
/// Under the hood it will use [`arrow_data::ArrayDataBuilder::align_buffers`] to construct
/// [`arrow_data::ArrayData`].
pub fn with_require_alignment(mut self, require_alignment: bool) -> Self {
self.require_alignment = require_alignment;
Expand Down
2 changes: 1 addition & 1 deletion arrow-ipc/src/reader/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl StreamDecoder {
/// If `require_alignment` is false (the default), this decoder will automatically allocate a
/// new aligned buffer and copy over the data if any array data in the input `buf` is not
/// properly aligned. (Properly aligned array data will remain zero-copy.)
/// Under the hood it will use [`arrow_data::ArrayDataBuilder::build_aligned`] to construct
/// Under the hood it will use [`arrow_data::ArrayDataBuilder::align_buffers`] to construct
/// [`arrow_data::ArrayData`].
pub fn with_require_alignment(mut self, require_alignment: bool) -> Self {
self.require_alignment = require_alignment;
Expand Down
Loading
Loading