Skip to content
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

DOC: Validate parameter types in docstrings (e.g. str instead of string) #23165

Merged
merged 3 commits into from
Oct 21, 2018

Conversation

Moisan
Copy link
Contributor

@Moisan Moisan commented Oct 15, 2018

  • tests added / passed
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff

Related to #20298. Fixes the bullet "Using string, boolean, integer in the param descriptions (should be str, bool, int)".

@pep8speaks
Copy link

pep8speaks commented Oct 15, 2018

Hello @Moisan! Thanks for updating the PR.

Comment last updated on October 15, 2018 at 14:38 Hours UTC

@codecov
Copy link

codecov bot commented Oct 15, 2018

Codecov Report

Merging #23165 into master will increase coverage by 0.04%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #23165      +/-   ##
==========================================
+ Coverage   92.14%   92.19%   +0.04%     
==========================================
  Files         170      169       -1     
  Lines       51017    50959      -58     
==========================================
- Hits        47011    46980      -31     
+ Misses       4006     3979      -27
Flag Coverage Δ
#multiple 90.61% <ø> (+0.04%) ⬆️
#single 42.29% <ø> (-0.02%) ⬇️
Impacted Files Coverage Δ
pandas/plotting/_compat.py 87.5% <0%> (-3.81%) ⬇️
pandas/compat/numpy/__init__.py 92.85% <0%> (-1.09%) ⬇️
pandas/plotting/_converter.py 63.82% <0%> (-0.07%) ⬇️
pandas/core/util/hashing.py 98.4% <0%> (ø) ⬆️
pandas/core/frame.py 97.11% <0%> (ø) ⬆️
pandas/compat/pickle_compat.py 75.6% <0%> (ø) ⬆️
pandas/core/dtypes/common.py 95.11% <0%> (ø) ⬆️
pandas/core/arrays/__init__.py 100% <0%> (ø) ⬆️
pandas/core/sparse/api.py 100% <0%> (ø) ⬆️
pandas/core/sparse/array.py
... and 8 more

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 cf11f71...26bf7be. Read the comment docs.

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.

Thanks for this, it's very useful. I'd just add the mentioned test, as it's more common having multiple types than just one.

----------
kind : boolean
Foo bar baz.
"""
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 one test or two for something like list of boolean, integer, float or string... I think it makes sense to make sure that we capture them, and that the error in this case makes sense.

@datapythonista datapythonista added Docs CI Continuous Integration labels Oct 15, 2018
@datapythonista datapythonista changed the title TST: add a check for common parameters type error in doctests DOC: Validate parameter types in docstrings (e.g. str instead of string) Oct 15, 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, thanks @Moisan

@WillAyd can you take a look?

@WillAyd WillAyd merged commit a784aee into pandas-dev:master Oct 21, 2018
@WillAyd
Copy link
Member

WillAyd commented Oct 21, 2018

Thanks @Moisan !

@Moisan Moisan deleted the common_docstring_type_error branch October 22, 2018 00:47
JustinZhengBC pushed a commit to JustinZhengBC/pandas that referenced this pull request Oct 23, 2018
tm9k1 pushed a commit to tm9k1/pandas that referenced this pull request Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration Docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants