Skip to content

Commit ce2f9f5

Browse files
committed
fix: update RecordBatchStream methods to return pa.RecordBatch instances
1 parent c35ee60 commit ce2f9f5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

python/datafusion/record_batch.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,17 @@ def __init__(self, record_batch_stream: df_internal.RecordBatchStream) -> None:
6060
"""This constructor is typically not called by the end user."""
6161
self.rbs = record_batch_stream
6262

63-
def next(self) -> RecordBatch:
64-
"""See :py:func:`__next__` for the iterator function."""
63+
def next(self) -> pa.RecordBatch:
64+
"""Retrieve the next :py:class:`pa.RecordBatch`."""
6565
return next(self)
6666

67-
async def __anext__(self) -> RecordBatch:
68-
"""Async iterator function."""
67+
async def __anext__(self) -> pa.RecordBatch:
68+
"""Async iterator returning :py:class:`pa.RecordBatch`."""
6969
next_batch = await self.rbs.__anext__()
70-
return RecordBatch(next_batch)
70+
return next_batch.to_pyarrow()
7171

7272
def __next__(self) -> pa.RecordBatch:
73-
"""Iterator function."""
73+
"""Iterator returning :py:class:`pa.RecordBatch`."""
7474
next_batch = next(self.rbs)
7575
return next_batch.to_pyarrow()
7676

0 commit comments

Comments
 (0)