Skip to content

Commit 50fe1c1

Browse files
committed
docs: clarify RecordBatch reference and add PyArrow conversion example
1 parent ba4711f commit 50fe1c1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

docs/source/user-guide/dataframe/index.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,15 @@ PyArrow:
175175
.. code-block:: python
176176
177177
for batch in df:
178-
... # each batch is a ``RecordBatch``
178+
... # each batch is a ``datafusion.RecordBatch``
179+
180+
Each batch exposes ``to_pyarrow()``, allowing conversion to a PyArrow
181+
table without collecting everything eagerly:
182+
183+
.. code-block:: python
184+
185+
import pyarrow as pa
186+
table = pa.Table.from_batches(b.to_pyarrow() for b in df)
179187
180188
Asynchronous iteration is supported as well, allowing integration with
181189
``asyncio`` event loops:

0 commit comments

Comments
 (0)