Skip to content

Add docstring examples for Aggregate basic and bitwise/boolean functions#1416

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

Add docstring examples for Aggregate basic and bitwise/boolean functions#1416
ntjohnson1 wants to merge 1 commit intoapache:mainfrom
rerun-io:nick/docstrings-agg-basic

Conversation

@ntjohnson1
Copy link
Contributor

Which issue does this PR close?

Rationale for this change

Add example usage to docstrings for Aggregate basic and bitwise/boolean 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 Aggregate basic and bitwise/boolean 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 +1902 to +1904
>>> result = df.aggregate(
... [], [dfn.functions.approx_distinct(dfn.col("a")).alias("v")])
>>> result.collect_column("v")[0].as_py() >= 2
Copy link
Contributor

Choose a reason for hiding this comment

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

>= 2 is a weak regression signal for a 4-row input with 3 distinct values.

Could we pick an input where the approximation is still deterministic enough to show a concrete answer, or at least tighten the expectation so the example documents the intended behavior more clearly?

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