Skip to content

Commit 501a8df

Browse files
committed
deprecate all decompression methods without a context
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
1 parent 824e3c4 commit 501a8df

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

vortex-array/src/array/erased.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,13 @@ impl ArrayRef {
292292
}
293293

294294
/// Returns the canonical representation of the array.
295+
#[deprecated(note = "use `array.execute::<Canonical>(ctx)` instead")]
295296
pub fn into_canonical(self) -> VortexResult<Canonical> {
296297
self.execute(&mut LEGACY_SESSION.create_execution_ctx())
297298
}
298299

299300
/// Returns the canonical representation of the array.
301+
#[deprecated(note = "use `array.execute::<Canonical>(ctx)` instead")]
300302
pub fn to_canonical(&self) -> VortexResult<Canonical> {
301303
self.clone().into_canonical()
302304
}

vortex-array/src/array/typed.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ impl<V: VTable> Array<V> {
376376
self.inner.all_invalid()
377377
}
378378

379+
#[deprecated(note = "Use execute::<Canonical>(ctx) instead")]
379380
pub fn to_canonical(&self) -> VortexResult<crate::Canonical> {
380381
self.inner.to_canonical()
381382
}

vortex-array/src/canonical.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,35 +427,44 @@ impl IntoArray for Canonical {
427427
/// This trait has a blanket implementation for all types implementing [ToCanonical].
428428
pub trait ToCanonical {
429429
/// Canonicalize into a [`NullArray`] if the target is [`Null`](DType::Null) typed.
430+
#[deprecated(note = "use `array.execute::<NullArray>(ctx)` instead")]
430431
fn to_null(&self) -> NullArray;
431432

432433
/// Canonicalize into a [`BoolArray`] if the target is [`Bool`](DType::Bool) typed.
434+
#[deprecated(note = "use `array.execute::<BoolArray>(ctx)` instead")]
433435
fn to_bool(&self) -> BoolArray;
434436

435437
/// Canonicalize into a [`PrimitiveArray`] if the target is [`Primitive`](DType::Primitive)
436438
/// typed.
439+
#[deprecated(note = "use `array.execute::<PrimitiveArray>(ctx)` instead")]
437440
fn to_primitive(&self) -> PrimitiveArray;
438441

439442
/// Canonicalize into a [`DecimalArray`] if the target is [`Decimal`](DType::Decimal)
440443
/// typed.
444+
#[deprecated(note = "use `array.execute::<DecimalArray>(ctx)` instead")]
441445
fn to_decimal(&self) -> DecimalArray;
442446

443447
/// Canonicalize into a [`StructArray`] if the target is [`Struct`](DType::Struct) typed.
448+
#[deprecated(note = "use `array.execute::<StructArray>(ctx)` instead")]
444449
fn to_struct(&self) -> StructArray;
445450

446451
/// Canonicalize into a [`ListViewArray`] if the target is [`List`](DType::List) typed.
452+
#[deprecated(note = "use `array.execute::<ListViewArray>(ctx)` instead")]
447453
fn to_listview(&self) -> ListViewArray;
448454

449455
/// Canonicalize into a [`FixedSizeListArray`] if the target is [`List`](DType::FixedSizeList)
450456
/// typed.
457+
#[deprecated(note = "use `array.execute::<FixedSizeListArray>(ctx)` instead")]
451458
fn to_fixed_size_list(&self) -> FixedSizeListArray;
452459

453460
/// Canonicalize into a [`VarBinViewArray`] if the target is [`Utf8`](DType::Utf8)
454461
/// or [`Binary`](DType::Binary) typed.
462+
#[deprecated(note = "use `array.execute::<VarBinViewArray>(ctx)` instead")]
455463
fn to_varbinview(&self) -> VarBinViewArray;
456464

457465
/// Canonicalize into an [`ExtensionArray`] if the array is [`Extension`](DType::Extension)
458466
/// typed.
467+
#[deprecated(note = "use `array.execute::<ExtensionArray>(ctx)` instead")]
459468
fn to_extension(&self) -> ExtensionArray;
460469
}
461470

0 commit comments

Comments
 (0)