Skip to content

DOC: fix return type of str.extract #22562

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 2 commits into from
Sep 3, 2018
Merged

DOC: fix return type of str.extract #22562

merged 2 commits into from
Sep 3, 2018

Conversation

zhujun98
Copy link
Contributor

@zhujun98 zhujun98 commented Sep 1, 2018

  • closes #xxxx
  • tests added / passed
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

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

Great changes. Adding some things that could be improved in the original docstring.

expression pat will be used for column names; otherwise
capture group numbers will be used. The dtype of each result
column is always object, even when no match is found. If
expand=False and pat has only one capture group, then return
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 add double backticks around expand=False? (i.e. ``expand=True``)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

column is always object, even when no match is found. If
expand=False and pat has only one capture group, then return
a Series (if subject is a Series) or Index (if subject is an
Index).
Copy link
Member

Choose a reason for hiding this comment

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

according to this, it can also return a Series or Index, do you mind adding it to the type? So, instead of DataFrame it's DataFrame, Series or Index

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

I addressed the above three issues in one commit. Hopefully it works. Next time, I suppose I should separate them.

``re`` module flags, e.g. ``re.IGNORECASE``.
See :mod:`re`
One of the ``re`` module flags, e.g. ``re.IGNORECASE``.
See :mod:`re`.
Copy link
Member

Choose a reason for hiding this comment

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

Do you mind briefly explaining what these flags are about. Nothing long, but something a bit more descriptive than what we've got now just linking to the re documentation. Something like "Flags that modify regular expression matching for things like case, spaces, etc."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@codecov
Copy link

codecov bot commented Sep 2, 2018

Codecov Report

Merging #22562 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #22562   +/-   ##
=======================================
  Coverage   92.04%   92.04%           
=======================================
  Files         169      169           
  Lines       50787    50787           
=======================================
  Hits        46745    46745           
  Misses       4042     4042
Flag Coverage Δ
#multiple 90.45% <ø> (ø) ⬆️
#single 42.29% <ø> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/strings.py 98.63% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 98fb53c...acd9147. Read the comment docs.

@datapythonista datapythonista added the Strings String extension data type and string data label Sep 2, 2018
Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

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

lgtm

@datapythonista
Copy link
Member

Thanks for the changes @zhujun98

No need to address the comments in a PR in separate commits, that's rarely done. Feel free to fix all them in a single commit, unless separating them adds value to you.

Can you merge master in your branch and push it, so the CI runs again, and hopefully this time all is green please.

@zhujun98
Copy link
Contributor Author

zhujun98 commented Sep 2, 2018

Thanks for the explanation @datapythonista

I am a little bit confused about the next step. To trigger the CI again, do you mean 'git merge upstream/master' or 'git rebase upstream/master'?

By the way, I checked other PRs (e.g. #22571) and it seems there is some issue with Anaconda now.

@gfyoung
Copy link
Member

gfyoung commented Sep 3, 2018

Anaconda is back to normal, so I restarted all of your failed builds. In terms of re-triggering builds, you have two options:

  • Ping us: then we can restart the failing builds instead of re-triggering the entire build.
  • "Redo" your last commit as follows:
git commit --amend
git push -f

@zhujun98
Copy link
Contributor Author

zhujun98 commented Sep 3, 2018

Thank you for the information @gfyoung!

Finally we got all the green lights @datapythonista! Thank you very much for guiding me through the whole workflow of contributing to Pandas docstrings! I really enjoyed it

@datapythonista
Copy link
Member

Another option to what @gfyoung said is git fetch upstream && git merge upstream/master, which is what I initially proposed. As pandas is quite active it rarely won't have anything to merge, and it has the advantage that if there is any conflict, you'll detect it directly.

Changes lgtm, but will let someone else merge it, so we have an extra pair of eyes on the changes.

@WillAyd WillAyd merged commit 100906e into pandas-dev:master Sep 3, 2018
Sup3rGeo pushed a commit to Sup3rGeo/pandas that referenced this pull request Oct 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Strings String extension data type and string data
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants