Uh oh!
There was an error while loading. Please reload this page.
Add docstring examples for Common utility functions - #1419
Conversation
Add example usage to docstrings for Common utility functions to improve documentation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
kosiew
left a comment
There was a problem hiding this comment.
@ntjohnson1
Thanks for working on this.
| >>> result = df.select( | ||
| ... dfn.functions.array_join(dfn.col("a"), dfn.lit("-")).alias("s")) |
There was a problem hiding this comment.
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.
| Parameters: | ||
| ----------- |
There was a problem hiding this comment.
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.
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