Skip to content

Conversation

@josquinlarsen
Copy link

@josquinlarsen josquinlarsen commented Nov 30, 2025

I had issues updating my original PR (#63201), I redid it to account for formatting fixes. File: pandas/core/groupby/groupby.py

@josquinlarsen josquinlarsen changed the title fixing doc formatting issues for pipe DOC #62437 Replace @Substitution and @Appender Nov 30, 2025
@josquinlarsen josquinlarsen changed the title DOC #62437 Replace @Substitution and @Appender DOC #62437 Replace @Substitution and @Appender in core/groupby/groupby.py Nov 30, 2025
@josquinlarsen josquinlarsen changed the title DOC #62437 Replace @Substitution and @Appender in core/groupby/groupby.py DOC 62437 Replace @Substitution and @Appender in core/groupby/groupby.py Nov 30, 2025
Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

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

Looking good!

Comment on lines 799 to 803
>>> df
A B
A B
0 a 1
1 b 2
2 a 3
Copy link
Member

Choose a reason for hiding this comment

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

This change is wrong, the columns should be adjusted. Is pre-commit doing this with the ruff formater?

Copy link
Author

Choose a reason for hiding this comment

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

Fixed! I think this is a holdover from the contents of the generated docstring I printed to console.

>>> df.groupby('A').pipe(lambda x: x.max() - x.min())
B
>>> df.groupby("A").pipe(lambda x: x.max() - x.min())
B
Copy link
Member

Choose a reason for hiding this comment

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

Ditto.

Copy link
Author

@josquinlarsen josquinlarsen Dec 5, 2025

Choose a reason for hiding this comment

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

I misunderstood the example. Fixed alignment of A B to match columns

Thank you for the feedback!

Copy link
Author

Choose a reason for hiding this comment

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

I tried to combine lines 810/811 (i.e. A B) but that was causing Code Checks/Docstrings to fail. I reverted to the two lines and it's passing now, but doesn't look right in the file. I've not been able to find other examples that follow a pattern like that to see what others have done

@josquinlarsen josquinlarsen changed the title DOC 62437 Replace @Substitution and @Appender in core/groupby/groupby.py DOC: 62437 Replace @Substitution and @Appender in core/groupby/groupby.py Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DOC: Replace @Appender, @Substitution, @doc with inlined docstrings

2 participants