Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: return values don't show up in docs #1293

Open
96 tasks
MarcoGorelli opened this issue Oct 31, 2024 · 3 comments
Open
96 tasks

docs: return values don't show up in docs #1293

MarcoGorelli opened this issue Oct 31, 2024 · 3 comments
Labels
blocked documentation Improvements or additions to documentation reserved for sprint please don't submit a PR for this issue just yet

Comments

@MarcoGorelli
Copy link
Member

MarcoGorelli commented Oct 31, 2024

edit by @marenwestermann [WIP]

Add a "Returns" section to the doc strings of functions and methods which concisely describes what is being returned.
Start with one or two functions at a time. Once you feel familiar with the documentation process you can update several functions at a time (remember to ideally keep your pull requests small). For more details and an example see below.

List of functions/ methods that need the "Returns"documentation:

  • dataframe.py
    DataFrame:

    • lazy
    • to_pandas
    • write_csv
    • write_parquet
    • to_numpy
    • shape
    • get_column
    • to_dict
    • row
    • pipe
    • drop_nulls
    • with_row_index
    • schema
    • collect_schema
    • columns
    • rows
    • iter_rows
    • select
    • rename
    • head
    • tail
    • drop
    • unique
    • filter
    • sort
    • is_duplicated
    • is_empty
    • is_unique
    • null_count
    • item
    • clone
    • gather_every
    • to_arrow
    • sample
    • unpivot

    LazyFrame

    • pipe
    • drop_nulls
    • with_row_index
    • schema
    • collect_schema
    • columns
    • select
    • rename
    • head
    • tail
    • drop
    • filter
    • group_by
    • sort
    • clone
    • lazy
    • gather_every
    • unpivot
  • expr.py
    Expr

    • Expr
    • alias
    • pipe
    • cast
    • any
    • all
    • mean
    • median
    • std
    • map_batches
    • sum
    • min
    • max
    • count
    • n_unique
    • unique
    • abs
    • cum_sum
    • diff
    • shift
    • replace_strict
    • sort
    • is_between
    • is_in
    • filter
    • is_null
    • arg_true
    • fill_null
    • drop_nulls
    • sample
    • over
    • is_duplicated
    • null_count
    • is_first_distinct
    • is_last_distinct
    • quantile
    • head
    • tail
    • round
    • len
    • gather_every
    • clip
    • mode
@MarcoGorelli MarcoGorelli added documentation Improvements or additions to documentation high priority labels Oct 31, 2024
@MarcoGorelli
Copy link
Member Author

we can resolve this by adding a Returns section, which will then pick up on the type annotations:

e.g. for from_dict:

    Returns:
        DataFrame

@marenwestermann
Copy link
Contributor

marenwestermann commented Nov 6, 2024

I can start working on this one. Just for clarification:

  • this should be done for all public functions that are exposed to the user, right?
  • you follow the Google docstring format, correct? Edit: found the specification in the pyproject.toml file 😊

@MarcoGorelli
Copy link
Member Author

wonderful, thanks!

yes, that's right!

@MarcoGorelli MarcoGorelli added blocked reserved for sprint please don't submit a PR for this issue just yet and removed high priority labels Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked documentation Improvements or additions to documentation reserved for sprint please don't submit a PR for this issue just yet
Projects
None yet
Development

No branches or pull requests

2 participants