Add docstring examples for Scalar array/list functions#1420
Open
ntjohnson1 wants to merge 1 commit intoapache:mainfrom
Open
Add docstring examples for Scalar array/list functions#1420ntjohnson1 wants to merge 1 commit intoapache:mainfrom
ntjohnson1 wants to merge 1 commit intoapache:mainfrom
Conversation
Add example usage to docstrings for Scalar array/list functions to improve documentation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
kosiew
reviewed
Mar 13, 2026
Contributor
kosiew
left a comment
There was a problem hiding this comment.
@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`. | |||
Contributor
There was a problem hiding this comment.
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")) | |||
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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