File tree 3 files changed +5
-5
lines changed 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -982,7 +982,7 @@ impl PySessionContext {
982
982
) -> PyResult < PyRecordBatchStream > {
983
983
let ctx: TaskContext = TaskContext :: from ( & self . ctx . state ( ) ) ;
984
984
// create a Tokio runtime to run the async code
985
- let rt = & get_tokio_runtime ( py ) . 0 ;
985
+ let rt = & get_tokio_runtime ( ) . 0 ;
986
986
let plan = plan. plan . clone ( ) ;
987
987
let fut: JoinHandle < datafusion:: common:: Result < SendableRecordBatchStream > > =
988
988
rt. spawn ( async move { plan. execute ( part, Arc :: new ( ctx) ) } ) ;
Original file line number Diff line number Diff line change @@ -543,7 +543,7 @@ impl PyDataFrame {
543
543
544
544
fn execute_stream ( & self , py : Python ) -> PyResult < PyRecordBatchStream > {
545
545
// create a Tokio runtime to run the async code
546
- let rt = & get_tokio_runtime ( py ) . 0 ;
546
+ let rt = & get_tokio_runtime ( ) . 0 ;
547
547
let df = self . df . as_ref ( ) . clone ( ) ;
548
548
let fut: JoinHandle < datafusion:: common:: Result < SendableRecordBatchStream > > =
549
549
rt. spawn ( async move { df. execute_stream ( ) . await } ) ;
@@ -553,7 +553,7 @@ impl PyDataFrame {
553
553
554
554
fn execute_stream_partitioned ( & self , py : Python ) -> PyResult < Vec < PyRecordBatchStream > > {
555
555
// create a Tokio runtime to run the async code
556
- let rt = & get_tokio_runtime ( py ) . 0 ;
556
+ let rt = & get_tokio_runtime ( ) . 0 ;
557
557
let df = self . df . as_ref ( ) . clone ( ) ;
558
558
let fut: JoinHandle < datafusion:: common:: Result < Vec < SendableRecordBatchStream > > > =
559
559
rt. spawn ( async move { df. execute_stream_partitioned ( ) . await } ) ;
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ use std::sync::{Arc, OnceLock};
24
24
use tokio:: runtime:: Runtime ;
25
25
26
26
/// Utility to get the Tokio Runtime from Python
27
- pub ( crate ) fn get_tokio_runtime ( _ : Python ) -> Arc < TokioRuntime > {
27
+ pub ( crate ) fn get_tokio_runtime ( ) -> Arc < TokioRuntime > {
28
28
static RUNTIME : OnceLock < Arc < TokioRuntime > > = OnceLock :: new ( ) ;
29
29
RUNTIME
30
30
. get_or_init ( || {
40
40
F : Future + Send ,
41
41
F :: Output : Send ,
42
42
{
43
- let runtime: & Runtime = & get_tokio_runtime ( py ) . 0 ;
43
+ let runtime: & Runtime = & get_tokio_runtime ( ) . 0 ;
44
44
py. allow_threads ( || runtime. block_on ( f) )
45
45
}
46
46
You can’t perform that action at this time.
0 commit comments