Skip to content

Commit 2794c88

Browse files
committed
Update PyArrow streaming example to use pa.table for eager collection
1 parent b66b441 commit 2794c88

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,13 @@ PyArrow:
178178
... # each batch is a ``datafusion.RecordBatch``
179179
180180
Each batch exposes ``to_pyarrow()``, allowing conversion to a PyArrow
181-
table without collecting everything eagerly:
181+
table. ``pa.table(df)`` collects the entire DataFrame eagerly into a
182+
PyArrow table:
182183

183184
.. code-block:: python
184185
185186
import pyarrow as pa
186-
table = pa.Table.from_batches(b.to_pyarrow() for b in df)
187+
table = pa.table(df)
187188
188189
Asynchronous iteration is supported as well, allowing integration with
189190
``asyncio`` event loops:

0 commit comments

Comments
 (0)