8000 remove unused argument from get_tokio_runtime · apache/datafusion-python@18c6098 · GitHub
[go: up one dir, main page]

Skip to content
Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 18c6098

Browse files
remove unused argument from get_tokio_runtime
1 parent 163b221 commit 18c6098

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ impl PySessionContext {
982982
) -> PyResult<PyRecordBatchStream> {
983983
let ctx: TaskContext = TaskContext::from(&self.ctx.state());
984984
// create a Tokio runtime to run the async code
985-
let rt = &get_tokio_runtime(py).0;
985+
let rt = &get_tokio_runtime().0;
986986
let plan = plan.plan.clone();
987987
let fut: JoinHandle<datafusion::common::Result<SendableRecordBatchStream>> =
988988
rt.spawn(async move { plan.execute(part, Arc::new(ctx)) });

src/dataframe.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ impl PyDataFrame {
543543

544544
fn execute_stream(&self, py: Python) -> PyResult<PyRecordBatchStream> {
545545
// create a Tokio runtime to run the async code
546-
let rt = &get_tokio_runtime(py).0;
546+
let rt = &get_tokio_runtime().0;
547547
let df = self.df.as_ref().clone();
548548
let fut: JoinHandle<datafusion::common::Result<SendableRecordBatchStream>> =
549549
rt.spawn(async move { df.execute_stream().await });
@@ -553,7 +553,7 @@ impl PyDataFrame {
553553

554554
fn execute_stream_partitioned(&self, py: Python) -> PyResult<Vec<PyRecordBatchStream>> {
555555
// create a Tokio runtime to run the async code
556-
let rt = &get_tokio_runtime(py).0;
556+
let rt = &get_tokio_runtime().0;
557557
let df = self.df.as_ref().clone();
558558
let fut: JoinHandle<datafusion::common::Result<Vec<SendableRecordBatchStream>>> =
559559
rt.spawn(async move { df.execute_stream_partitioned().await });

src/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use std::sync::{Arc, OnceLock};
2424
use tokio::runtime::Runtime;
2525

2626
/// 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> {
2828
static RUNTIME: OnceLock<Arc<TokioRuntime>> = OnceLock::new();
2929
RUNTIME
3030
.get_or_init(|| {
@@ -40,7 +40,7 @@ where
4040
F: Future + Send,
4141
F::Output: Send,
4242
{
43-
let runtime: &Runtime = &get_tokio_runtime(py).0;
43+
let runtime: &Runtime = &get_tokio_runtime().0;
4444
py.allow_threads(|| runtime.block_on(f))
4545
}
4646

0 commit comments

Comments
 (0)
0