@@ -12,7 +12,8 @@ use geoarrow::datatypes::{Dimension, NativeType};
1212use pyo3:: exceptions:: PyValueError ;
1313use pyo3:: intern;
1414use pyo3:: prelude:: * ;
15- use pyo3:: types:: { PyBytes , PyDict , PyString , PyTuple } ;
15+ use pyo3:: pybacked:: PyBackedBytes ;
16+ use pyo3:: types:: { PyDict , PyString , PyTuple } ;
1617use pyo3:: PyAny ;
1718use pyo3_geoarrow:: PyGeoArrowResult ;
1819
@@ -90,7 +91,7 @@ pub fn from_shapely(
9091 shapely_mod. call_method ( intern ! ( py, "to_ragged_array" ) , ( input, ) , Some ( & kwargs) )
9192 {
9293 let ( geom_type, coords, offsets) =
93- ragged_array_output. extract :: < ( & PyAny , Bound < PyAny > , PyObject ) > ( ) ?;
94+ ragged_array_output. extract :: < ( Bound < PyAny > , Bound < PyAny > , PyObject ) > ( ) ?;
9495 let coords = numpy_mod. call_method1 (
9596 intern ! ( py, "ascontiguousarray" ) ,
9697 PyTuple :: new_bound ( py, vec ! [ coords] ) ,
@@ -181,8 +182,8 @@ fn make_wkb_arr(
181182 let mut builder = BinaryBuilder :: with_capacity ( wkb_result. len ( ) ?, 0 ) ;
182183
183184 for item in wkb_result. iter ( ) ? {
184- let x = item?. extract :: < & PyBytes > ( ) ?;
185- builder. append_value ( x . as_bytes ( ) ) ;
185+ let buf = item?. extract :: < PyBackedBytes > ( ) ?;
186+ builder. append_value ( buf . as_ref ( ) ) ;
186187 }
187188
188189 Ok ( geoarrow:: array:: WKBArray :: new ( builder. finish ( ) , metadata) )
0 commit comments