File tree Expand file tree Collapse file tree 4 files changed +24
-6
lines changed
vortex-layout/src/layouts/dict Expand file tree Collapse file tree 4 files changed +24
-6
lines changed Original file line number Diff line number Diff line change @@ -100,12 +100,14 @@ fuzz_target!(|fuzz: FuzzFileAction| -> Corpus {
100100 assert_eq!(
101101 expected_array. len( ) ,
102102 output_array. len( ) ,
103- "Length was not preserved."
103+ "Length was not preserved expected {} actual {}." ,
104+ expected_array. len( ) ,
105+ output_array. len( )
104106 ) ;
105107 assert_eq!(
106108 expected_array. dtype( ) ,
107109 output_array. dtype( ) ,
108- "DTypes aren't preserved expected {}, actual {}" ,
110+ "DTypes aren't preserved expected {}, actual {}. " ,
109111 expected_array. dtype( ) ,
110112 output_array. dtype( )
111113 ) ;
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ impl VTable for GetItem {
8080 }
8181
8282 fn fmt_data ( & self , instance : & Self :: Instance , f : & mut Formatter < ' _ > ) -> std:: fmt:: Result {
83- write ! ( f, "\" {}\" " , instance. inner ( ) . as_ref ( ) )
83+ write ! ( f, "\" {}\" " , instance)
8484 }
8585
8686 fn return_dtype ( & self , expr : & ExpressionView < Self > , scope : & DType ) -> VortexResult < DType > {
Original file line number Diff line number Diff line change @@ -68,6 +68,18 @@ impl MaskFuture {
6868 let inner = self . inner . clone ( ) ;
6969 Self :: new ( range. len ( ) , async move { Ok ( inner. await ?. slice ( range) ) } )
7070 }
71+
72+ pub fn inspect (
73+ self ,
74+ f : impl FnOnce ( & SharedVortexResult < Mask > ) + ' static + Send + Sync ,
75+ ) -> Self {
76+ let len = self . len ;
77+
78+ Self {
79+ inner : self . inner . inspect ( f) . boxed ( ) . shared ( ) ,
80+ len,
81+ }
82+ }
7183}
7284
7385impl Future for MaskFuture {
Original file line number Diff line number Diff line change @@ -174,12 +174,16 @@ impl LayoutReader for DictReader {
174174 let mask = mask. await ?;
175175
176176 // Short-circuit when the values are all true/false.
177- if let Some ( MinMaxResult { min, max } ) = min_max ( & values) ? {
178- if !max. as_bool ( ) . value ( ) . unwrap_or ( true ) {
177+ if values. all_valid ( )
178+ && let Some ( MinMaxResult { min, max } ) = min_max ( & values) ?
179+ {
180+ #[ expect( clippy:: bool_comparison, reason = "easy to follow" ) ]
181+ if max. as_bool ( ) . value ( ) . vortex_expect ( "non null" ) == false {
179182 // All values are false
180183 return Ok ( Mask :: AllFalse ( mask. len ( ) ) ) ;
181184 }
182- if min. as_bool ( ) . value ( ) . unwrap_or ( false ) {
185+ #[ expect( clippy:: bool_comparison, reason = "easy to follow" ) ]
186+ if min. as_bool ( ) . value ( ) . vortex_expect ( "not null" ) == true {
183187 // All values are true, but we still need to respect codes validity
184188 return Ok ( mask. bitand ( & codes. validity_mask ( ) ) ) ;
185189 }
You can’t perform that action at this time.
0 commit comments