Skip to content

Add docstring examples for Common utility functions#1419

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

Add docstring examples for Common utility functions#1419
ntjohnson1 wants to merge 1 commit intoapache:mainfrom
rerun-io:nick/docstrings-common

Conversation

@ntjohnson1
Copy link
Contributor

Which issue does this PR close?

Rationale for this change

Add example usage to docstrings for Common utility 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 Common utility 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 working on this.

Comment on lines +382 to +383
>>> result = df.select(
... dfn.functions.array_join(dfn.col("a"), dfn.lit("-")).alias("s"))
Copy link
Contributor

Choose a reason for hiding this comment

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

array_join, list_to_string, and list_join are all aliases of array_to_string, but each now carries its own slightly different example.

I think keeping the full runnable example on the canonical function and letting the aliases point to it to avoid three extra snippets to maintain whenever the preferred usage changes.

Comment on lines +508 to +509
Parameters:
-----------
Copy link
Contributor

Choose a reason for hiding this comment

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

This docstring switches from the file’s more common Args: convention to Parameters:.

It would be cleaner to keep the surrounding style consistent and add the example without changing the docstring format for just this one helper.

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