File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -40,8 +40,12 @@ fn pyarrow_function_to_rust(
40
40
// 1. cast args to Pyarrow arrays
41
41
let py_args = args
42
42
. iter ( )
43
- . map ( |arg| arg. into_data ( ) . to_pyarrow ( py) . unwrap ( ) )
44
- . collect :: < Vec < _ > > ( ) ;
43
+ . map ( |arg| {
44
+ arg. into_data ( )
45
+ . to_pyarrow ( py)
46
+ . map_err ( |e| DataFusionError :: Execution ( format ! ( "{e:?}" ) ) )
47
+ } )
48
+ . collect :: < Result < Vec < _ > , _ > > ( ) ?;
45
49
let py_args = PyTuple :: new_bound ( py, py_args) ;
46
50
47
51
// 2. call function
@@ -50,7 +54,8 @@ fn pyarrow_function_to_rust(
50
54
. map_err ( |e| DataFusionError :: Execution ( format ! ( "{e:?}" ) ) ) ?;
51
55
52
56
// 3. cast to arrow::array::Array
53
- let array_data = ArrayData :: from_pyarrow_bound ( value. bind ( py) ) . unwrap ( ) ;
57
+ let array_data = ArrayData :: from_pyarrow_bound ( value. bind ( py) )
58
+ . map_err ( |e| DataFusionError :: Execution ( format ! ( "{e:?}" ) ) ) ?;
54
59
Ok ( make_array ( array_data) )
55
60
} )
56
61
}
You can’t perform that action at this time.
0 commit comments