Skip to content

Commit 2a839d9

Browse files
committed
refactor: improve docstrings for DataFrame and RecordBatchStream methods
1 parent d6f5c86 commit 2a839d9

3 files changed

Lines changed: 12 additions & 7 deletions

File tree

docs/source/conf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@
7272
suppress_warnings = ["autoapi.python_import_resolution"]
7373
autoapi_python_class_content = "both"
7474
autoapi_keep_files = False # set to True for debugging generated files
75+
autoapi_options = [
76+
"members",
77+
"undoc-members",
78+
"special-members",
79+
"show-inheritance",
80+
]
7581

7682

7783
def autoapi_skip_member_fn(app, what, name, obj, skip, options) -> bool: # noqa: ARG001

python/datafusion/dataframe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ def into_view(self) -> pa.Table:
309309
return self.df.into_view()
310310

311311
def __getitem__(self, key: str | list[str]) -> DataFrame:
312-
"""Return a new :py:class`DataFrame` with the specified column or columns.
312+
"""Return a new :py:class:`DataFrame` with the specified column or columns.
313313
314314
Args:
315315
key: Column name or list of column names to select.

python/datafusion/record_batch.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,20 +83,19 @@ def next(self) -> RecordBatch:
8383
return next(self)
8484

8585
async def __anext__(self) -> RecordBatch:
86-
"""Async iterator function."""
86+
"""Return the next :py:class:`RecordBatch` in the stream asynchronously."""
8787
next_batch = await self.rbs.__anext__()
8888
return RecordBatch(next_batch)
8989

9090
def __next__(self) -> RecordBatch:
91-
"""Iterator function."""
91+
"""Return the next :py:class:`RecordBatch` in the stream."""
9292
next_batch = next(self.rbs)
9393
return RecordBatch(next_batch)
9494

95-
async def __aiter__(self) -> typing_extensions.Self:
96-
"""Async iterator function."""
97-
await self.rbs.__aiter__()
95+
def __aiter__(self) -> typing_extensions.Self:
96+
"""Return an asynchronous iterator over record batches."""
9897
return self
9998

10099
def __iter__(self) -> typing_extensions.Self:
101-
"""Iterator function."""
100+
"""Return an iterator over record batches."""
102101
return self

0 commit comments

Comments
 (0)