-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: fix PR02 errors in docstrings - pandas.core.groupby.SeriesGroupBy.idxmax, pandas.core.groupby.SeriesGroupBy.idxmin #57145
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
Conversation
…y.idxmax, pandas.core.groupby.SeriesGroupBy.idxmin
What's the reason to stop reusing the docstring here? Seems like the parameters are the same, no? |
@datapythonista the reason I removed I am open to other suggestions for resolving the PR02 errors if you know of other ways I can resolve this. |
@mroeschke can you take a look at the examples I added? |
I see. Sorry, I compared the one changed here with the one in The way we've been dealing with this is using variables for the parts that change. In this case you could create a new variable |
IMO I am generally in favor of moving away from dynamic docstring. Especially since docstrings are a good avenue for new contributions, I think the overhead of |
+1 |
You would also have to do something about the different examples, as now the groupby version has groupby-specific examples. |
@datapythonista considering the input above, is the effort to refactor this (main docstring + additional args + examples) worth undertaking at this time, or do we want to revisit that in a separate conversation outside of the scope of this PR? There are other similar PR02 errors that could be resolved with either approach. |
I was just pointing out at how we've been doing things so far. And as I said, I really don't know when reusing docstrings simplify things, and when it makes them more complex, it's probably more a personal preference than something we can agree with, and I don't have a strong opinion. So, I'm surely happy to let you decide how to move forward here. |
@jordan-d-murphy - when you merge main, you can remove any references to |
Thank you all so much for the guidance and feedback. For now, I'll refrain from refactoring the docstring into the dynamic approach. I've merged main back into this branch to resolve conflicts, and the pipeline is running again. I also removed the |
@rhshadrach in this PR I've removed axis for I see |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see
Series.idxmin
andSeries.idxmax
also have references toaxis
, should I remove those as well? I can update this PR with that change or open a separate PR for that fix if it's needed.
The axis argument in these methods will remain; the argument was only removed in the groupby variant.
@rhshadrach can you give another look at this when you get time? I've addressed the changes you requested |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Thanks @jordan-d-murphy! |
All PR02 Errors resolved in the following cases:
OUTPUT:
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.