@@ -121,6 +121,7 @@ mod op {
121
121
use super :: Error ;
122
122
123
123
/// Extracts a specific field from a struct component within a `ListArray`.
124
+ #[ derive( Debug ) ]
124
125
pub struct AccessField {
125
126
pub ( super ) field_name : String ,
126
127
}
@@ -157,6 +158,7 @@ mod op {
157
158
}
158
159
159
160
/// Casts the `value_type` (inner array) of a `ListArray` to a different data type.
161
+ #[ derive( Debug ) ]
160
162
pub struct Cast {
161
163
pub ( super ) to_inner_type : DataType ,
162
164
}
@@ -215,6 +217,16 @@ pub enum Op {
215
217
Func ( Box < dyn Fn ( ListArray ) -> Result < ListArray , Error > + Sync + Send > ) ,
216
218
}
217
219
220
+ impl std:: fmt:: Debug for Op {
221
+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
222
+ match self {
223
+ Self :: AccessField ( inner) => f. debug_tuple ( "AccessField" ) . field ( inner) . finish ( ) ,
224
+ Self :: Cast ( inner) => f. debug_tuple ( "Cast" ) . field ( inner) . finish ( ) ,
225
+ Self :: Func ( _) => f. debug_tuple ( "Func" ) . field ( & "<function>" ) . finish ( ) ,
226
+ }
227
+ }
228
+ }
229
+
218
230
impl Op {
219
231
/// Extracts a specific field from a `StructArray`.
220
232
pub fn access_field ( field_name : impl Into < String > ) -> Self {
@@ -378,12 +390,19 @@ impl Lens {
378
390
379
391
let mut list_array_result = list_array. clone ( ) ;
380
392
for op in & output. ops {
381
- if let Ok ( result) = op. call ( list_array_result) {
382
- list_array_result = result;
383
- } else {
384
- // TODO: context!
385
- re_log:: error!( "failed" ) ;
386
- return vec ! [ ] ;
393
+ match op. call ( list_array_result) {
394
+ Ok ( result) => {
395
+ list_array_result = result;
396
+ }
397
+ Err ( err) => {
398
+ re_log:: error!(
399
+ "Lens operation '{:?}' failed for output column '{}' on entity '{}': {err}" ,
400
+ op,
401
+ output. entity_path,
402
+ output. component_descr. component
403
+ ) ;
404
+ return vec ! [ ] ;
405
+ }
387
406
}
388
407
}
389
408
0 commit comments