Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upDOC: Fix validation error type `RT01` and check in CI (#25356) #26234
Conversation
ihsansecer
added some commits
Apr 27, 2019
jreback
added
the
Style
label
Apr 28, 2019
This comment has been minimized.
This comment has been minimized.
codecov
bot
commented
Apr 28, 2019
Codecov Report
@@ Coverage Diff @@
## master #26234 +/- ##
==========================================
- Coverage 91.98% 91.97% -0.01%
==========================================
Files 175 175
Lines 52372 52373 +1
==========================================
- Hits 48172 48168 -4
- Misses 4200 4205 +5
Continue to review full report at Codecov.
|
This comment has been minimized.
This comment has been minimized.
codecov
bot
commented
Apr 28, 2019
•
Codecov Report
@@ Coverage Diff @@
## master #26234 +/- ##
==========================================
- Coverage 91.98% 91.97% -0.01%
==========================================
Files 175 175
Lines 52372 52387 +15
==========================================
+ Hits 48172 48182 +10
- Misses 4200 4205 +5
Continue to review full report at Codecov.
|
WillAyd
requested changes
Apr 29, 2019
pandas/core/base.py Outdated
| @@ -1388,6 +1388,10 @@ def to_gbq(self, destination_table, project_id=None, chunksize=None, | |||
| or string contents. This is useful for remote server | |||
| authentication (eg. Jupyter/IPython notebook on remote host). | |||
| Returns | |||
| ------- | |||
| None | |||
This comment has been minimized.
This comment has been minimized.
WillAyd
Apr 29, 2019
Member
IIRC the validator should detect when there is no return and not require it to be explicitly stated
This comment has been minimized.
This comment has been minimized.
ihsansecer
Apr 29, 2019
•
Author
Contributor
There is actually an empty return statement (This is the function returned by pandas to_gbq function) .
This comment has been minimized.
This comment has been minimized.
WillAyd
Apr 29, 2019
Member
Right but it still shouldn't be required (see #25008) - was this giving you an error?
This comment has been minimized.
This comment has been minimized.
ihsansecer
Apr 29, 2019
•
Author
Contributor
Yes, it gives an error on my local. Should I check if it passes CI tests?
This comment has been minimized.
This comment has been minimized.
WillAyd
Apr 29, 2019
Member
Oh OK I see. Is this any different from the other io methods? This usually is None or str though totally familiar with pandas_gbq internals.
If it never actually returns anything probably better to update the code to not return instead of adding cruft to the docstring
This comment has been minimized.
This comment has been minimized.
ihsansecer
Apr 29, 2019
Author
Contributor
So I will remove the return sections of docstrings for to_gbq, to_hdf and to_pickle in this branch. Then open another PR for removing return statements of these functions. Right?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
datapythonista
May 1, 2019
Member
I think detecting all the docstrings with Returns set to None is trivial. Personally I'm happy to leave this as it is until we fix the code that detects whether something can be detected (so we can validate RT01 in the CI), and we can easily detect and remove them later.
This comment has been minimized.
This comment has been minimized.
pandas/core/generic.py Outdated
pandas/core/groupby/generic.py Outdated
pandas/core/groupby/groupby.py Outdated
pandas/tseries/offsets.py Outdated
WillAyd
added
the
Docs
label
Apr 29, 2019
ihsansecer
added some commits
Apr 29, 2019
jreback
added this to the 0.25.0 milestone
Apr 29, 2019
ihsansecer
added a commit
to ihsansecer/pandas
that referenced
this pull request
Apr 29, 2019
ihsansecer
referenced this pull request
Apr 29, 2019
Merged
CLN: Remove unnecessary io function returns #26238
ihsansecer
changed the title
Fix validation error type `RT01` and check in CI
DOC: Fix validation error type `RT01` and check in CI (#25356)
Apr 29, 2019
datapythonista
reviewed
May 1, 2019
|
Good stuff, thanks for the work on this. Added couple of comments, but looks good. |
| @@ -1388,6 +1388,10 @@ def to_gbq(self, destination_table, project_id=None, chunksize=None, | |||
| or string contents. This is useful for remote server | |||
| authentication (eg. Jupyter/IPython notebook on remote host). | |||
| Returns | |||
| ------- | |||
| None | |||
This comment has been minimized.
This comment has been minimized.
datapythonista
May 1, 2019
Member
I think detecting all the docstrings with Returns set to None is trivial. Personally I'm happy to leave this as it is until we fix the code that detects whether something can be detected (so we can validate RT01 in the CI), and we can easily detect and remove them later.
| @@ -1845,7 +1850,13 @@ def __hash__(self): | |||
| ' hashed'.format(self.__class__.__name__)) | |||
|
|
|||
| def __iter__(self): | |||
| """Iterate over info axis""" | |||
| """Iterate over info axis. | |||
This comment has been minimized.
This comment has been minimized.
datapythonista
May 1, 2019
Member
Can you move the short summary to the next line please:
"""
Iterate over info axis.
| Returns | ||
| ------- | ||
| None or str |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
ihsansecer
May 1, 2019
Author
Contributor
It is written in the same way as is in other to_* io functions. It returns str only when a path or buffer-like is not provided. I believe it mostly returns None which makes writing None or str more reasonable IMO.
pandas/core/groupby/generic.py Outdated
| Returns | ||
| ------- | ||
| Series or DataFrame | ||
| Nth value within each group. |
This comment has been minimized.
This comment has been minimized.
| Returns | ||
| ------- | ||
| scalar | ||
| A value in the series with the indice of the key value in self. |
ihsansecer commentedApr 28, 2019
./scripts/validate_docstrings.py --errors=RT01git diff upstream/master -u -- "*.py" | flake8 --diff