File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -43,16 +43,16 @@ impl PyArrowConvert for ScalarValue {
43
43
let array = factory. call1 ( ( args, typ) ) ?;
44
44
45
45
// convert the pyarrow array to rust array using C data interface
46
- let array = array. extract :: < ArrayData > ( ) ? ;
47
- let scalar = ScalarValue :: try_from_array ( & array. into ( ) , 0 ) ?;
46
+ let array = arrow :: array:: make_array ( ArrayData :: from_pyarrow ( array ) ? ) ;
47
+ let scalar = ScalarValue :: try_from_array ( & array, 0 ) ?;
48
48
49
49
Ok ( scalar)
50
50
}
51
51
52
52
fn to_pyarrow ( & self , py : Python ) -> PyResult < PyObject > {
53
53
let array = self . to_array ( ) ;
54
54
// convert to pyarrow array using C data interface
55
- let pyarray = array. data_ref ( ) . clone ( ) . into_py ( py) ;
55
+ let pyarray = array. data ( ) . to_pyarrow ( py) ? ;
56
56
let pyscalar = pyarray. call_method1 ( py, "__getitem__" , ( 0 , ) ) ?;
57
57
58
58
Ok ( pyscalar)
You can’t perform that action at this time.
0 commit comments