Skip to content

Conversation

@Deen-dot
Copy link
Contributor

@Deen-dot Deen-dot commented Feb 19, 2024

Fixed PR01 errors (#57438) and added parameter descriptions for:

  • pandas.Grouper
  • pandas.core.groupby.DataFrameGroupBy.cummax
  • pandas.core.groupby.DataFrameGroupBy.cummin
  • pandas.core.groupby.DataFrameGroupBy.cumprod
  • pandas.core.groupby.DataFrameGroupBy.cumsum
  • pandas.core.groupby.DataFrameGroupBy.filter
  • pandas.core.groupby.DataFrameGroupBy.pct_change
  • pandas.core.groupby.DataFrameGroupBy.rolling
  • pandas.core.groupby.SeriesGroupBy.nunique
  • pandas.core.groupby.SeriesGroupBy.cummax
  • pandas.core.groupby.SeriesGroupBy.cummin
  • pandas.core.groupby.SeriesGroupBy.cumprod
  • pandas.core.groupby.SeriesGroupBy.cumsum
  • pandas.core.groupby.SeriesGroupBy.cumprod

Fixed functions also removed from code_checks.sh

Fixed PR01 errors (pandas-dev#57438) and added parameter descriptions for:
- `pandas.Grouper`
- `pandas.core.groupby.DataFrameGroupBy.cummax`
- `pandas.core.groupby.DataFrameGroupBy.cummin`
- `pandas.core.groupby.DataFrameGroupBy.cumprod`
- `pandas.core.groupby.DataFrameGroupBy.cumsum`
- `pandas.core.groupby.DataFrameGroupBy.filter`
- `pandas.core.groupby.DataFrameGroupBy.pct_change`
- `pandas.core.groupby.DataFrameGroupBy.rolling`
- `pandas.core.groupby.SeriesGroupBy.cummax`
- `pandas.core.groupby.SeriesGroupBy.cummin`
- `pandas.core.groupby.SeriesGroupBy.cumprod`
- `pandas.core.groupby.SeriesGroupBy.cumsum`
- `pandas.core.groupby.SeriesGroupBy.cumprod`

Fixed functions also removed from code_checks.sh
Resolved a PR02 documentation error arising from the inherited `nunique` method docstring within `groupby.SeriesGroupBy.nunique`. The issue was due to the `resample.Resampler.nunique` method lacking a `dropna` parameter, which is present in the inherited docstring.

- Introduced `_nunique_extra_params` to dynamically insert parameter documentation only where applicable (i.e. where `groupby.SeriesGroupBy.nunique`is).

@final
@doc(SeriesGroupBy.nunique)
@doc(SeriesGroupBy.nunique, extra_params="")
Copy link
Member

Choose a reason for hiding this comment

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

Can you give this a distinct docstring (e.g. copy-paste the SeriesGroupBy.nunique docstring here) and avoid using doc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good. Since they're now their own distinct docstrings, I separated the examples too (added see alsos to each other instead)

"""
)

@doc(extra_params=_nunique_extra_params)
Copy link
Member

Choose a reason for hiding this comment

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

Connecting with my other comment, can you avoid using doc here?

@mroeschke mroeschke added the Docs label Feb 20, 2024
@mroeschke mroeschke added this to the 3.0 milestone Feb 21, 2024
@mroeschke mroeschke merged commit 2493681 into pandas-dev:main Feb 21, 2024
@mroeschke
Copy link
Member

Thanks @Deen-dot

pmhatre1 pushed a commit to pmhatre1/pandas-pmhatre1 that referenced this pull request May 7, 2024
…#57504)

* DOC: Fix PR01 errors in multiple files (pandas-dev#57438)

Fixed PR01 errors (pandas-dev#57438) and added parameter descriptions for:
- `pandas.Grouper`
- `pandas.core.groupby.DataFrameGroupBy.cummax`
- `pandas.core.groupby.DataFrameGroupBy.cummin`
- `pandas.core.groupby.DataFrameGroupBy.cumprod`
- `pandas.core.groupby.DataFrameGroupBy.cumsum`
- `pandas.core.groupby.DataFrameGroupBy.filter`
- `pandas.core.groupby.DataFrameGroupBy.pct_change`
- `pandas.core.groupby.DataFrameGroupBy.rolling`
- `pandas.core.groupby.SeriesGroupBy.cummax`
- `pandas.core.groupby.SeriesGroupBy.cummin`
- `pandas.core.groupby.SeriesGroupBy.cumprod`
- `pandas.core.groupby.SeriesGroupBy.cumsum`
- `pandas.core.groupby.SeriesGroupBy.cumprod`

Fixed functions also removed from code_checks.sh

* Updated formatting

* Corrected E501 formatting

* Remove trailing whitespaces

* Fix PR02 error from docstring inheritance for resampler nunique method

Resolved a PR02 documentation error arising from the inherited `nunique` method docstring within `groupby.SeriesGroupBy.nunique`. The issue was due to the `resample.Resampler.nunique` method lacking a `dropna` parameter, which is present in the inherited docstring.

- Introduced `_nunique_extra_params` to dynamically insert parameter documentation only where applicable (i.e. where `groupby.SeriesGroupBy.nunique`is).

* Resolve request

* Undo mistake

* Remove unnecessary import to fix ruff check
@Deen-dot Deen-dot deleted the PR01-fixes branch August 31, 2024 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants