@@ -427,35 +427,44 @@ impl IntoArray for Canonical {
427427/// This trait has a blanket implementation for all types implementing [ToCanonical].
428428pub 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