timsaucer commented on code in PR #1141: URL: https://github.com/apache/datafusion-python/pull/1141#discussion_r2145268554
########## src/dataframe.rs: ########## @@ -763,14 +763,10 @@ impl PyDataFrame { let df = self.df.as_ref().clone(); let fut: JoinHandle<datafusion::common::Result<Vec<SendableRecordBatchStream>>> = rt.spawn(async move { df.execute_stream_partitioned().await }); - let stream = wait_for_future(py, fut).map_err(py_datafusion_err)?; + let stream = wait_for_future(py, async { fut.await.expect("Tokio task panicked") })? Review Comment: ```suggestion let stream = wait_for_future(py, async { fut.await })? .map_err(|e| PyRuntimeError::new_err(format!("{e}")))? .map_err(py_datafusion_err)?; ``` ########## src/dataframe.rs: ########## @@ -753,8 +753,8 @@ impl PyDataFrame { let df = self.df.as_ref().clone(); let fut: JoinHandle<datafusion::common::Result<SendableRecordBatchStream>> = rt.spawn(async move { df.execute_stream().await }); - let stream = wait_for_future(py, fut).map_err(py_datafusion_err)?; - Ok(PyRecordBatchStream::new(stream?)) + let stream = wait_for_future(py, async { fut.await.expect("Tokio task panicked") })??; Review Comment: ```suggestion let stream = wait_for_future(py, async { fut.await })? .map_err(|e| PyRuntimeError::new_err(format!("{e}")))??; ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org