MCPcopy Create free account
hub / github.com/apache/arrow / ReadNext

Method ReadNext

python/pyarrow/src/arrow/python/ipc.cc:39–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37std::shared_ptr<Schema> PyRecordBatchReader::schema() const { return schema_; }
38
39Status 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
60Result<std::shared_ptr<RecordBatchReader>> PyRecordBatchReader::Make(
61 std::shared_ptr<Schema> schema, PyObject* iterable) {

Callers

nothing calls this directly

Calls 15

SafeFunction · 0.85
CastFunction · 0.85
nullableMethod · 0.80
OKFunction · 0.50
InvalidFunction · 0.50
ARROW_ASSIGN_OR_RAISEFunction · 0.50
MakeFunction · 0.50
resetMethod · 0.45
ValueMethod · 0.45
num_columnsMethod · 0.45
columnMethod · 0.45
fieldMethod · 0.45

Tested by

no test coverage detected