Skip to content

DOC:GH34026 #34059

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

Merged
merged 5 commits into from
May 16, 2020
Merged

Conversation

moaraccounts
Copy link
Contributor

@moaraccounts moaraccounts commented May 7, 2020

@pep8speaks
Copy link

pep8speaks commented May 7, 2020

Hello @moaraccounts! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2020-05-15 18:27:11 UTC

@moaraccounts
Copy link
Contributor Author

moaraccounts commented May 8, 2020

EDIT: headdesk. I was on the wrong branch. Never mind. Should be good to go.

I'm not sure what I'm doing wrong. I'm following this guide
I just fixed the white space issues, then manually ran code_checks.sh for docstrings, lint, and patterns. I'm attaching those three outputs. I also ran git diff upstream/master -u -- "*.py" | flake8 --diff with no issues.

When I run git push origin <my-branch>, I receive Everything up-to-date. For some reason, the CI checks are still failing. Any suggestions?

check_docstrings.txt
check_lint.txt
check_patterns.txt

@MarcoGorelli
Copy link
Member

Thanks @moaraccounts

CI failures are unrelated

Did you try building the documentation locally? https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#contributing-to-the-documentation

@moaraccounts
Copy link
Contributor Author

Thanks @moaraccounts

CI failures are unrelated

Did you try building the documentation locally? https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#contributing-to-the-documentation

@MarcoGorelli Yes indeed. I can build the documentation locally and see my changes. Attached are the screenshots of rstrip and lstrip. Do those help?
lstrip
rstrip

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

Cool, thanks for attaching the screenshots, looks good

@MarcoGorelli
Copy link
Member

@moaraccounts mind if I ask why you closed this?

@moaraccounts
Copy link
Contributor Author

Ooh, I thought since the changes were approved I could close it! My bad! I will reopen.

@moaraccounts moaraccounts reopened this May 14, 2020
@MarcoGorelli
Copy link
Member

It's OK :) A core dev will review this eventually (please be patient though, there's a long queue) and merge it

@moaraccounts
Copy link
Contributor Author

Awesome! Ok, no worries on the waiting. Thank you!

@mroeschke mroeschke added this to the 1.1 milestone May 14, 2020
@MarcoGorelli
Copy link
Member

MarcoGorelli commented May 14, 2020

CI failures are unrelated

My bad, CI failures are related, you need to get

python scripts/validate_docstrings.py pandas.Series.str.lstrip

and

python scripts/validate_docstrings.py pandas.Series.str.rstrip

to pass

EDIT

python scripts/validate_docstrings.py pandas.Series.str.strip

too

@@ -2977,8 +2977,6 @@ def encode(self, encoding, errors="strict"):
_shared_docs[
"str_strip"
] = r"""
Remove leading and trailing characters.
Copy link
Member

Choose a reason for hiding this comment

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

It might be simpler to add a substitution here, something like

Suggested change
Remove leading and trailing characters.
Remove %(position)s characters.

and then, at the top of the def of lstrip, inside dict, add position="leading" (and similarly "trailing" for rstrip)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gotcha, I see. Ok, I'll fix those then commit again. ty!

@@ -3040,20 +3040,27 @@ def encode(self, encoding, errors="strict"):
"""

@Appender(
_shared_docs["str_strip"] % dict(side="left and right sides", method="strip")
_shared_docs["str_strip"]
% dict(side="left and right sides", method="strip", position=None)
Copy link
Member

@MarcoGorelli MarcoGorelli May 15, 2020

Choose a reason for hiding this comment

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

Doesn't strip remove both leading and trailing characters? Should this be

        % dict(side="left and right sides", method="strip", position="leading and trailing")

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh hell. Yes, it should have both leading and trailing. Fixing now and will push. Thank you.

…cumentation locally to confirm changes (pandas-dev34026)
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

Thanks @moaraccounts - I built the docs locally and they look as expected

@mroeschke mroeschke merged commit 9f7b9fc into pandas-dev:master May 16, 2020
@mroeschke
Copy link
Member

Thanks @moaraccounts! Nice contribution

jbrockmendel pushed a commit to jbrockmendel/pandas that referenced this pull request May 17, 2020
* DOC:GH34026

* DOC:Fixing desc. for  Series.str.rstrip() and Series.str.lstrip() (pandas-dev#34026)

* DOC:Removed text strings from lstrip and rstrip. Added a new %position item to each dict. (pandas-dev34026)

* DOC:Fixed strip so %position now reads leading and trailing. Built documentation locally to confirm changes (pandas-dev34026)

Co-authored-by: Lesley <[email protected]>
@moaraccounts moaraccounts deleted the pandas-documentation-fixes branch May 19, 2020 20:51
@moaraccounts
Copy link
Contributor Author

Thank you!

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.

DOC: Series.str.rstrip() and Series.str.lstrip() have incorrect description at the top
5 participants