@@ -51,7 +51,7 @@ impl FlussTable {
5151
5252 let py_writer = AppendWriter :: from_core ( rust_writer) ;
5353
54- Python :: with_gil ( |py| Py :: new ( py, py_writer) )
54+ Python :: attach ( |py| Py :: new ( py, py_writer) )
5555 } )
5656 }
5757
@@ -75,7 +75,7 @@ impl FlussTable {
7575 . map_err ( |e| FlussError :: new_err ( e. to_string ( ) ) ) ?;
7676
7777 let py_scanner = LogScanner :: from_core ( rust_scanner, admin, table_info. clone ( ) ) ;
78- Python :: with_gil ( |py| Py :: new ( py, py_scanner) )
78+ Python :: attach ( |py| Py :: new ( py, py_scanner) )
7979 } )
8080 }
8181
@@ -131,10 +131,10 @@ pub struct AppendWriter {
131131#[ pymethods]
132132impl AppendWriter {
133133 /// Write Arrow table data
134- pub fn write_arrow ( & mut self , py : Python , table : PyObject ) -> PyResult < ( ) > {
134+ pub fn write_arrow ( & mut self , py : Python , table : Py < PyAny > ) -> PyResult < ( ) > {
135135 // Convert Arrow Table to batches and write each batch
136136 let batches = table. call_method0 ( py, "to_batches" ) ?;
137- let batch_list: Vec < PyObject > = batches. extract ( py) ?;
137+ let batch_list: Vec < Py < PyAny > > = batches. extract ( py) ?;
138138
139139 for batch in batch_list {
140140 self . write_arrow_batch ( py, batch) ?;
@@ -143,7 +143,7 @@ impl AppendWriter {
143143 }
144144
145145 /// Write Arrow batch data
146- pub fn write_arrow_batch ( & mut self , py : Python , batch : PyObject ) -> PyResult < ( ) > {
146+ pub fn write_arrow_batch ( & mut self , py : Python , batch : Py < PyAny > ) -> PyResult < ( ) > {
147147 // Extract number of rows and columns from the Arrow batch
148148 let num_rows: usize = batch. getattr ( py, "num_rows" ) ?. extract ( py) ?;
149149 let num_columns: usize = batch. getattr ( py, "num_columns" ) ?. extract ( py) ?;
@@ -175,7 +175,7 @@ impl AppendWriter {
175175 }
176176
177177 /// Write Pandas DataFrame data
178- pub fn write_pandas ( & mut self , py : Python , df : PyObject ) -> PyResult < ( ) > {
178+ pub fn write_pandas ( & mut self , py : Python , df : Py < PyAny > ) -> PyResult < ( ) > {
179179 // Import pyarrow module
180180 let pyarrow = py. import ( "pyarrow" ) ?;
181181
@@ -213,7 +213,7 @@ impl AppendWriter {
213213 fn convert_python_value_to_datum (
214214 & self ,
215215 py : Python ,
216- value : PyObject ,
216+ value : Py < PyAny > ,
217217 ) -> PyResult < fcore:: row:: Datum < ' static > > {
218218 use fcore:: row:: { Blob , Datum , F32 , F64 } ;
219219
@@ -321,7 +321,7 @@ impl LogScanner {
321321 }
322322
323323 /// Convert all data to Arrow Table
324- fn to_arrow ( & self , py : Python ) -> PyResult < PyObject > {
324+ fn to_arrow ( & self , py : Python ) -> PyResult < Py < PyAny > > {
325325 use std:: collections:: HashMap ;
326326 use std:: time:: Duration ;
327327
@@ -387,7 +387,7 @@ impl LogScanner {
387387 }
388388
389389 /// Convert all data to Pandas DataFrame
390- fn to_pandas ( & self , py : Python ) -> PyResult < PyObject > {
390+ fn to_pandas ( & self , py : Python ) -> PyResult < Py < PyAny > > {
391391 let arrow_table = self . to_arrow ( py) ?;
392392
393393 // Convert Arrow Table to Pandas DataFrame using pyarrow
0 commit comments