Skip to content

Add docstring examples for Scalar array/list functions#1420

Open
ntjohnson1 wants to merge 1 commit intoapache:mainfrom
rerun-io:nick/docstrings-scalar-array
Open

Add docstring examples for Scalar array/list functions#1420
ntjohnson1 wants to merge 1 commit intoapache:mainfrom
rerun-io:nick/docstrings-scalar-array

Conversation

@ntjohnson1
Copy link
Contributor

Which issue does this PR close?

Rationale for this change

Add example usage to docstrings for Scalar array/list functions to improve documentation.

What changes are included in this PR?

The first PR was basically adding a docstring to everything in functions. I broke it apart into a PR (that already merged) for the infra. I then reviewed and merged an example PR of adding the docstrings in parts. This is now the follow up opening a handful of PRs for the remaining functions in functions.py Everything is co-authored with Claude since I used claude to extend the handwritten examples I wrote for reference and to split apart the large PR rather than doing it manually.

I've reviewed all the code prior to PR.

Are there any user-facing changes?

No

Add example usage to docstrings for Scalar array/list functions to improve documentation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

@kosiew kosiew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ntjohnson1
Thanks for your contribution

@@ -1352,6 +1362,14 @@ def make_list(*args: Expr) -> Expr:
"""Returns an array using the specified input expressions.

This is an alias for :py:func:`make_array`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alias functions now duplicate a lot of near-identical doctest text. For cases like make_list/array and the various list_* or array_* aliases, consider keeping the runnable example on the canonical function and letting alias docstrings point back to it. That would keep this module smaller and make future example edits less repetitive.

@@ -2013,6 +2689,14 @@ def array_agg(
For example::

df.aggregate([], array_agg(col("a"), order_by="b"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

array_agg is an aggregate function rather than a scalar array/list helper, so its new example feels a little outside the stated scope of this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants