| 37 | std::shared_ptr<Schema> PyRecordBatchReader::schema() const { return schema_; } |
| 38 | |
| 39 | Status PyRecordBatchReader::ReadNext(std::shared_ptr<RecordBatch>* batch) { |
| 40 | PyAcquireGIL lock; |
| 41 | |
| 42 | if (!iterator_) { |
| 43 | // End of stream |
| 44 | batch->reset(); |
| 45 | return Status::OK(); |
| 46 | } |
| 47 | |
| 48 | OwnedRef py_batch(PyIter_Next(iterator_.obj())); |
| 49 | if (!py_batch) { |
| 50 | RETURN_IF_PYERROR(); |
| 51 | // End of stream |
| 52 | batch->reset(); |
| 53 | iterator_.reset(); |
| 54 | return Status::OK(); |
| 55 | } |
| 56 | |
| 57 | return unwrap_batch(py_batch.obj()).Value(batch); |
| 58 | } |
| 59 | |
| 60 | Result<std::shared_ptr<RecordBatchReader>> PyRecordBatchReader::Make( |
| 61 | std::shared_ptr<Schema> schema, PyObject* iterable) { |
nothing calls this directly
no test coverage detected