Skip to content

Commit a860956

Browse files
committed
Enhance documentation to clarify that DataFrame objects are iterable, yielding pyarrow.RecordBatch instances lazily.
1 parent b2ed37c commit a860956

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,14 @@ out-of-memory errors.
168168
for batch in reader:
169169
... # process each batch as it is produced
170170
171+
DataFrames are also iterable, yielding :class:`pyarrow.RecordBatch` objects
172+
lazily so you can loop over results directly:
173+
174+
.. code-block:: python
175+
176+
for batch in df:
177+
... # process each batch as it is produced
178+
171179
See :doc:`../io/arrow` for additional details on the Arrow interface.
172180

173181
HTML Rendering

python/datafusion/dataframe.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,9 @@ def __init__(
290290
class DataFrame:
291291
"""Two dimensional table representation of data.
292292
293+
DataFrame objects are iterable; iterating over a DataFrame yields
294+
:class:`pyarrow.RecordBatch` instances lazily.
295+
293296
See :ref:`user_guide_concepts` in the online documentation for more information.
294297
"""
295298

0 commit comments

Comments
 (0)