@@ -443,6 +443,7 @@ mod tests {
443443
444444 #[ test]
445445 fn test_nullable_lists_non_nullable_elements ( ) {
446+ let mut ctx = LEGACY_SESSION . create_execution_ctx ( ) ;
446447 let dtype: Arc < DType > = Arc :: new ( DType :: Primitive ( I32 , NonNullable ) ) ;
447448 let mut builder = FixedSizeListBuilder :: with_capacity ( Arc :: clone ( & dtype) , 2 , Nullable , 0 ) ;
448449
@@ -474,21 +475,21 @@ mod tests {
474475 fsl_array
475476 . validity( )
476477 . vortex_expect( "fixed-size-list validity should be derivable" )
477- . execute_is_valid( 0 , & mut LEGACY_SESSION . create_execution_ctx ( ) )
478+ . execute_is_valid( 0 , & mut ctx )
478479 . unwrap( )
479480 ) ;
480481 assert ! (
481482 !fsl_array
482483 . validity( )
483484 . vortex_expect( "fixed-size-list validity should be derivable" )
484- . execute_is_valid( 1 , & mut LEGACY_SESSION . create_execution_ctx ( ) )
485+ . execute_is_valid( 1 , & mut ctx )
485486 . unwrap( )
486487 ) ;
487488 assert ! (
488489 fsl_array
489490 . validity( )
490491 . vortex_expect( "fixed-size-list validity should be derivable" )
491- . execute_is_valid( 2 , & mut LEGACY_SESSION . create_execution_ctx ( ) )
492+ . execute_is_valid( 2 , & mut ctx )
492493 . unwrap( )
493494 ) ;
494495 }
@@ -561,6 +562,7 @@ mod tests {
561562
562563 #[ test]
563564 fn test_append_nulls ( ) {
565+ let mut ctx = LEGACY_SESSION . create_execution_ctx ( ) ;
564566 // Elements must be nullable if we're going to append null lists
565567 let dtype: Arc < DType > = Arc :: new ( DType :: Primitive ( I32 , Nullable ) ) ;
566568 let mut builder = FixedSizeListBuilder :: with_capacity ( dtype, 2 , Nullable , 0 ) ;
@@ -582,14 +584,15 @@ mod tests {
582584 !fsl_array
583585 . validity( )
584586 . vortex_expect( "fixed-size-list validity should be derivable" )
585- . execute_is_valid( i, & mut LEGACY_SESSION . create_execution_ctx ( ) )
587+ . execute_is_valid( i, & mut ctx )
586588 . unwrap( )
587589 ) ;
588590 }
589591 }
590592
591593 #[ test]
592594 fn test_append_scalar_nulls ( ) {
595+ let mut ctx = LEGACY_SESSION . create_execution_ctx ( ) ;
593596 // Elements must be nullable if we're going to append null lists
594597 let dtype: Arc < DType > = Arc :: new ( DType :: Primitive ( I32 , Nullable ) ) ;
595598 let mut builder = FixedSizeListBuilder :: with_capacity ( dtype, 2 , Nullable , 0 ) ;
@@ -612,7 +615,7 @@ mod tests {
612615 !fsl_array
613616 . validity( )
614617 . vortex_expect( "fixed-size-list validity should be derivable" )
615- . execute_is_valid( 0 , & mut LEGACY_SESSION . create_execution_ctx ( ) )
618+ . execute_is_valid( 0 , & mut ctx )
616619 . unwrap( )
617620 ) ;
618621 }
@@ -662,6 +665,7 @@ mod tests {
662665
663666 #[ test]
664667 fn test_extend_from_array ( ) {
668+ let mut ctx = LEGACY_SESSION . create_execution_ctx ( ) ;
665669 let dtype: Arc < DType > = Arc :: new ( I32 . into ( ) ) ;
666670
667671 // Create a source array.
@@ -690,48 +694,49 @@ mod tests {
690694 fsl_array
691695 . validity( )
692696 . vortex_expect( "fixed-size-list validity should be derivable" )
693- . execute_is_valid( 0 , & mut LEGACY_SESSION . create_execution_ctx ( ) )
697+ . execute_is_valid( 0 , & mut ctx )
694698 . unwrap( )
695699 ) ;
696700 assert ! (
697701 !fsl_array
698702 . validity( )
699703 . vortex_expect( "fixed-size-list validity should be derivable" )
700- . execute_is_valid( 1 , & mut LEGACY_SESSION . create_execution_ctx ( ) )
704+ . execute_is_valid( 1 , & mut ctx )
701705 . unwrap( )
702706 ) ;
703707 assert ! (
704708 fsl_array
705709 . validity( )
706710 . vortex_expect( "fixed-size-list validity should be derivable" )
707- . execute_is_valid( 2 , & mut LEGACY_SESSION . create_execution_ctx ( ) )
711+ . execute_is_valid( 2 , & mut ctx )
708712 . unwrap( )
709713 ) ;
710714 assert ! (
711715 fsl_array
712716 . validity( )
713717 . vortex_expect( "fixed-size-list validity should be derivable" )
714- . execute_is_valid( 3 , & mut LEGACY_SESSION . create_execution_ctx ( ) )
718+ . execute_is_valid( 3 , & mut ctx )
715719 . unwrap( )
716720 ) ;
717721 assert ! (
718722 !fsl_array
719723 . validity( )
720724 . vortex_expect( "fixed-size-list validity should be derivable" )
721- . execute_is_valid( 4 , & mut LEGACY_SESSION . create_execution_ctx ( ) )
725+ . execute_is_valid( 4 , & mut ctx )
722726 . unwrap( )
723727 ) ;
724728 assert ! (
725729 fsl_array
726730 . validity( )
727731 . vortex_expect( "fixed-size-list validity should be derivable" )
728- . execute_is_valid( 5 , & mut LEGACY_SESSION . create_execution_ctx ( ) )
732+ . execute_is_valid( 5 , & mut ctx )
729733 . unwrap( )
730734 ) ;
731735 }
732736
733737 #[ test]
734738 fn test_extend_degenerate_arrays ( ) {
739+ let mut ctx = LEGACY_SESSION . create_execution_ctx ( ) ;
735740 let dtype: Arc < DType > = Arc :: new ( I32 . into ( ) ) ;
736741
737742 // Create degenerate source arrays (size = 0).
@@ -767,35 +772,35 @@ mod tests {
767772 fsl_array
768773 . validity( )
769774 . vortex_expect( "fixed-size-list validity should be derivable" )
770- . execute_is_valid( 0 , & mut LEGACY_SESSION . create_execution_ctx ( ) )
775+ . execute_is_valid( 0 , & mut ctx )
771776 . unwrap( )
772777 ) ;
773778 assert ! (
774779 !fsl_array
775780 . validity( )
776781 . vortex_expect( "fixed-size-list validity should be derivable" )
777- . execute_is_valid( 1 , & mut LEGACY_SESSION . create_execution_ctx ( ) )
782+ . execute_is_valid( 1 , & mut ctx )
778783 . unwrap( )
779784 ) ;
780785 assert ! (
781786 fsl_array
782787 . validity( )
783788 . vortex_expect( "fixed-size-list validity should be derivable" )
784- . execute_is_valid( 2 , & mut LEGACY_SESSION . create_execution_ctx ( ) )
789+ . execute_is_valid( 2 , & mut ctx )
785790 . unwrap( )
786791 ) ;
787792 assert ! (
788793 !fsl_array
789794 . validity( )
790795 . vortex_expect( "fixed-size-list validity should be derivable" )
791- . execute_is_valid( 3 , & mut LEGACY_SESSION . create_execution_ctx ( ) )
796+ . execute_is_valid( 3 , & mut ctx )
792797 . unwrap( )
793798 ) ;
794799 assert ! (
795800 fsl_array
796801 . validity( )
797802 . vortex_expect( "fixed-size-list validity should be derivable" )
798- . execute_is_valid( 4 , & mut LEGACY_SESSION . create_execution_ctx ( ) )
803+ . execute_is_valid( 4 , & mut ctx )
799804 . unwrap( )
800805 ) ;
801806 }
@@ -836,6 +841,7 @@ mod tests {
836841
837842 #[ test]
838843 fn test_mixed_operations ( ) {
844+ let mut ctx = LEGACY_SESSION . create_execution_ctx ( ) ;
839845 // Use nullable elements since we'll be appending nulls
840846 let dtype: Arc < DType > = Arc :: new ( DType :: Primitive ( I32 , Nullable ) ) ;
841847 let mut builder = FixedSizeListBuilder :: with_capacity ( Arc :: clone ( & dtype) , 2 , Nullable , 0 ) ;
@@ -879,48 +885,49 @@ mod tests {
879885 fsl_array
880886 . validity( )
881887 . vortex_expect( "fixed-size-list validity should be derivable" )
882- . execute_is_valid( 0 , & mut LEGACY_SESSION . create_execution_ctx ( ) )
888+ . execute_is_valid( 0 , & mut ctx )
883889 . unwrap( )
884890 ) ; // append_value
885891 assert ! (
886892 !fsl_array
887893 . validity( )
888894 . vortex_expect( "fixed-size-list validity should be derivable" )
889- . execute_is_valid( 1 , & mut LEGACY_SESSION . create_execution_ctx ( ) )
895+ . execute_is_valid( 1 , & mut ctx )
890896 . unwrap( )
891897 ) ; // append_null
892898 assert ! (
893899 fsl_array
894900 . validity( )
895901 . vortex_expect( "fixed-size-list validity should be derivable" )
896- . execute_is_valid( 2 , & mut LEGACY_SESSION . create_execution_ctx ( ) )
902+ . execute_is_valid( 2 , & mut ctx )
897903 . unwrap( )
898904 ) ; // append_zeros
899905 assert ! (
900906 fsl_array
901907 . validity( )
902908 . vortex_expect( "fixed-size-list validity should be derivable" )
903- . execute_is_valid( 3 , & mut LEGACY_SESSION . create_execution_ctx ( ) )
909+ . execute_is_valid( 3 , & mut ctx )
904910 . unwrap( )
905911 ) ; // append_zeros
906912 assert ! (
907913 !fsl_array
908914 . validity( )
909915 . vortex_expect( "fixed-size-list validity should be derivable" )
910- . execute_is_valid( 4 , & mut LEGACY_SESSION . create_execution_ctx ( ) )
916+ . execute_is_valid( 4 , & mut ctx )
911917 . unwrap( )
912918 ) ; // append_nulls
913919 assert ! (
914920 fsl_array
915921 . validity( )
916922 . vortex_expect( "fixed-size-list validity should be derivable" )
917- . execute_is_valid( 5 , & mut LEGACY_SESSION . create_execution_ctx ( ) )
923+ . execute_is_valid( 5 , & mut ctx )
918924 . unwrap( )
919925 ) ; // extend_from_array
920926 }
921927
922928 #[ test]
923929 fn test_append_scalar ( ) {
930+ let mut ctx = LEGACY_SESSION . create_execution_ctx ( ) ;
924931 let dtype: Arc < DType > = Arc :: new ( I32 . into ( ) ) ;
925932 let mut builder = FixedSizeListBuilder :: with_capacity ( Arc :: clone ( & dtype) , 2 , Nullable , 10 ) ;
926933
@@ -942,19 +949,15 @@ mod tests {
942949
943950 // Check actual values using scalar_at.
944951
945- let scalar0 = array
946- . execute_scalar ( 0 , & mut LEGACY_SESSION . create_execution_ctx ( ) )
947- . unwrap ( ) ;
952+ let scalar0 = array. execute_scalar ( 0 , & mut ctx) . unwrap ( ) ;
948953 let list0 = scalar0. as_list ( ) ;
949954 assert_eq ! ( list0. len( ) , 2 ) ;
950955 if let Some ( list0_items) = list0. elements ( ) {
951956 assert_eq ! ( list0_items[ 0 ] . as_primitive( ) . typed_value:: <i32 >( ) , Some ( 1 ) ) ;
952957 assert_eq ! ( list0_items[ 1 ] . as_primitive( ) . typed_value:: <i32 >( ) , Some ( 2 ) ) ;
953958 }
954959
955- let scalar1 = array
956- . execute_scalar ( 1 , & mut LEGACY_SESSION . create_execution_ctx ( ) )
957- . unwrap ( ) ;
960+ let scalar1 = array. execute_scalar ( 1 , & mut ctx) . unwrap ( ) ;
958961 let list1 = scalar1. as_list ( ) ;
959962 assert_eq ! ( list1. len( ) , 2 ) ;
960963 if let Some ( list1_items) = list1. elements ( ) {
@@ -967,21 +970,21 @@ mod tests {
967970 array
968971 . validity( )
969972 . vortex_expect( "fixed-size-list validity should be derivable" )
970- . execute_is_valid( 0 , & mut LEGACY_SESSION . create_execution_ctx ( ) )
973+ . execute_is_valid( 0 , & mut ctx )
971974 . unwrap( )
972975 ) ;
973976 assert ! (
974977 array
975978 . validity( )
976979 . vortex_expect( "fixed-size-list validity should be derivable" )
977- . execute_is_valid( 1 , & mut LEGACY_SESSION . create_execution_ctx ( ) )
980+ . execute_is_valid( 1 , & mut ctx )
978981 . unwrap( )
979982 ) ;
980983 assert ! (
981984 !array
982985 . validity( )
983986 . vortex_expect( "fixed-size-list validity should be derivable" )
984- . execute_is_valid( 2 , & mut LEGACY_SESSION . create_execution_ctx ( ) )
987+ . execute_is_valid( 2 , & mut ctx )
985988 . unwrap( )
986989 ) ;
987990
0 commit comments