File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -489,7 +489,6 @@ impl LogicalExtensionCodec for ForeignLogicalExtensionCodec {
489489
490490#[ cfg( test) ]
491491mod tests {
492- use std:: any:: Any ;
493492 use std:: sync:: Arc ;
494493
495494 use arrow:: array:: record_batch;
@@ -704,7 +703,7 @@ mod tests {
704703
705704 let returned_udf = foreign_codec. try_decode_udwf ( udf. name ( ) , & bytes) ?;
706705
707- assert ! ( ( returned_udf. inner( ) . as_ref ( ) as & dyn Any ) . is:: <Rank >( ) ) ;
706+ assert ! ( returned_udf. inner( ) . is:: <Rank >( ) ) ;
708707
709708 Ok ( ( ) )
710709 }
Original file line number Diff line number Diff line change @@ -410,7 +410,6 @@ impl PhysicalExtensionCodec for ForeignPhysicalExtensionCodec {
410410
411411#[ cfg( test) ]
412412pub ( crate ) mod tests {
413- use std:: any:: Any ;
414413 use std:: sync:: Arc ;
415414
416415 use arrow_schema:: { DataType , Field , Schema } ;
@@ -550,7 +549,7 @@ pub(crate) mod tests {
550549 buf. push ( Self :: MAGIC_NUMBER ) ;
551550
552551 let udf = node. inner ( ) ;
553- let Some ( udf) = ( udf. as_ref ( ) as & dyn Any ) . downcast_ref :: < Rank > ( ) else {
552+ let Some ( udf) = udf. downcast_ref :: < Rank > ( ) else {
554553 return exec_err ! ( "TestExtensionCodec only expects Rank UDWF" ) ;
555554 } ;
556555
@@ -654,7 +653,7 @@ pub(crate) mod tests {
654653
655654 let returned_udf = foreign_codec. try_decode_udwf ( udf. name ( ) , & bytes) ?;
656655
657- assert ! ( ( returned_udf. inner( ) . as_ref ( ) as & dyn Any ) . is:: <Rank >( ) ) ;
656+ assert ! ( returned_udf. inner( ) . is:: <Rank >( ) ) ;
658657
659658 Ok ( ( ) )
660659 }
Original file line number Diff line number Diff line change @@ -222,9 +222,7 @@ impl Clone for FFI_WindowUDF {
222222
223223impl From < Arc < WindowUDF > > for FFI_WindowUDF {
224224 fn from ( udf : Arc < WindowUDF > ) -> Self {
225- if let Some ( udwf) = ( udf. inner ( ) . as_ref ( ) as & dyn std:: any:: Any )
226- . downcast_ref :: < ForeignWindowUDF > ( )
227- {
225+ if let Some ( udwf) = udf. inner ( ) . downcast_ref :: < ForeignWindowUDF > ( ) {
228226 return udwf. udf . clone ( ) ;
229227 }
230228
@@ -474,20 +472,12 @@ mod tests {
474472
475473 // Verify local libraries can be downcast to their original
476474 let foreign_udwf: Arc < dyn WindowUDFImpl > = ( & ffi_udwf) . into ( ) ;
477- assert ! (
478- ( foreign_udwf. as_ref( ) as & dyn std:: any:: Any )
479- . downcast_ref:: <WindowShift >( )
480- . is_some( )
481- ) ;
475+ assert ! ( foreign_udwf. is:: <WindowShift >( ) ) ;
482476
483477 // Verify different library markers generate foreign providers
484478 ffi_udwf. library_marker_id = crate :: mock_foreign_marker_id;
485479 let foreign_udwf: Arc < dyn WindowUDFImpl > = ( & ffi_udwf) . into ( ) ;
486- assert ! (
487- ( foreign_udwf. as_ref( ) as & dyn std:: any:: Any )
488- . downcast_ref:: <ForeignWindowUDF >( )
489- . is_some( )
490- ) ;
480+ assert ! ( foreign_udwf. is:: <ForeignWindowUDF >( ) ) ;
491481
492482 Ok ( ( ) )
493483 }
Original file line number Diff line number Diff line change @@ -1333,7 +1333,7 @@ impl PhysicalExtensionCodec for UDFExtensionCodec {
13331333
13341334 fn try_encode_udwf ( & self , node : & WindowUDF , buf : & mut Vec < u8 > ) -> Result < ( ) > {
13351335 let binding = node. inner ( ) ;
1336- if let Some ( udwf) = ( binding. as_ref ( ) as & dyn Any ) . downcast_ref :: < CustomUDWF > ( ) {
1336+ if let Some ( udwf) = binding. downcast_ref :: < CustomUDWF > ( ) {
13371337 let proto = CustomUDWFNode {
13381338 payload : udwf. payload . clone ( ) ,
13391339 } ;
You can’t perform that action at this time.
0 commit comments