File tree 2 files changed +11
-4
lines changed 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -34,3 +34,10 @@ exclude = ["datafusion-cli"]
34
34
[profile .release ]
35
35
codegen-units = 1
36
36
lto = true
37
+
38
+ [patch .crates-io ]
39
+ arrow = { git = " https://github.com/tustvold/arrow-rs.git" , rev = " 6f62bb62f630cbd910ae5b1b04f97688af7c1b42" }
40
+ parquet = { git = " https://github.com/tustvold/arrow-rs.git" , rev = " 6f62bb62f630cbd910ae5b1b04f97688af7c1b42" }
41
+ arrow-buffer = { git = " https://github.com/tustvold/arrow-rs.git" , rev = " 6f62bb62f630cbd910ae5b1b04f97688af7c1b42" }
42
+ arrow-schema = { git = " https://github.com/tustvold/arrow-rs.git" , rev = " 6f62bb62f630cbd910ae5b1b04f97688af7c1b42" }
43
+ arrow-flight = { git = " https://github.com/tustvold/arrow-rs.git" , rev = " 6f62bb62f630cbd910ae5b1b04f97688af7c1b42" }
Original file line number Diff line number Diff line change 19
19
20
20
use crate :: { DataFusionError , ScalarValue } ;
21
21
use arrow:: array:: ArrayData ;
22
- use arrow:: pyarrow:: PyArrowConvert ;
22
+ use arrow:: pyarrow:: { PyArrowConvert , PyArrowType } ;
23
23
use pyo3:: exceptions:: PyException ;
24
24
use pyo3:: prelude:: PyErr ;
25
25
use pyo3:: types:: PyList ;
@@ -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 = array. extract :: < PyArrowType < ArrayData > > ( ) ?;
47
+ let scalar = ScalarValue :: try_from_array ( & array. 0 . into ( ) , 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 = PyArrowType ( array. data_ref ( ) . clone ( ) ) . into_py ( 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