We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c3d808c commit ccb4a5cCopy full SHA for ccb4a5c
src/record_batch.rs
@@ -63,9 +63,13 @@ impl PyRecordBatchStream {
63
impl PyRecordBatchStream {
64
fn next(&mut self, py: Python) -> PyResult<PyRecordBatch> {
65
let stream = self.stream.clone();
66
- wait_for_future(py, next_stream(stream, true))?
+ // Two-step error handling process:
67
+ // 1. First ? handles errors from the async runtime/future execution
68
+ let item = wait_for_future(py, next_stream(stream, true))?;
69
+ // 2. Second ? converts and propagates any DataFusion errors to Python errors
70
+ let batch = item.map_err(PyDataFusionError::from)?;
71
+ Ok(batch)
72
}
-
73
fn __next__(&mut self, py: Python) -> PyResult<PyRecordBatch> {
74
self.next(py)
75
0 commit comments