-
-
Notifications
You must be signed in to change notification settings - Fork 19.1k
Fix PR10 error and Clean up docstrings from functions related to RT05 errors #25132
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
Hello @thoo! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on February 28, 2019 at 01:28 Hours UTC |
Codecov Report
@@ Coverage Diff @@
## master #25132 +/- ##
=======================================
Coverage 92.37% 92.37%
=======================================
Files 166 166
Lines 52408 52408
=======================================
Hits 48411 48411
Misses 3997 3997
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #25132 +/- ##
==========================================
- Coverage 91.74% 91.74% -0.01%
==========================================
Files 173 173
Lines 52923 52923
==========================================
- Hits 48555 48554 -1
- Misses 4368 4369 +1
Continue to review full report at Codecov.
|
can you merge master. RT04 is now active, so I think you need to adjust some things. |
* upstream/master: TST/REF: collect DataFrame reduction tests (#24914) DOC: Improve docstring of Series.mul (#25136) Removal of return variable names (#25123) BUG: Fixing regression in DataFrame.all and DataFrame.any with bool_only=True (#25102) Reading a HDF5 created in py2 (#25058) DOC: Fix validation type error RT04 (#25107) (#25129)
* upstream/master: Fix validation error type `SS05` and check in CI (#25133)
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.
Looks good, some special cases can probably be improved
* upstream/master: DOC: Fix validation type error SA05 (#25208) REF: Add more pytest idiom to test_holiday.py (#25204) DOC/CLN: Fix errors in Series docstrings (#24945) TST: follow-up to Test nested pandas array #24993 (#25155) modernize compat imports (#25192) fix MacPython pandas-wheels failure (#25186) BUG: DataFrame.merge(suffixes=) does not respect None (#24819) DEPR: remove PanelGroupBy, disable DataFrame.to_panel (#25047) DOC: update docstring for series.nunique (#25116) CLN: Use ABCs in set_index (#25128) BLD: pin cython language level to '2' (#25145) DOC: Updates to Timestamp document (#25163) STY: use pytest.raises context manager (indexes/multi) (#25175) Fixed tuple to List Conversion in Dataframe class (#25089)
* upstream/master: fix ci failures (#25225) STY: use pytest.raises context manager (indexes/period) (#25199) DOC: exclude autogenerated c/cpp/html files from 'trailing whitespace' checks (#24549) DOC: Fixes to docstrings and add PR10 (space before colon) to validation (#25109) REF: Remove many Panel tests (#25191) BUG: Fix Series.is_unique with single occurrence of NaN (#25182)
@datapythonista if you'd re-look. merge when good. |
* upstream/master: BUG: Fix exceptions when Series.interpolate's `order` parameter is missing or invalid (#25246) API: Ensure DatetimeTZDtype standardizes pytz timezones (#25254) Split Excel IO Into Sub-Directory (#25153) PR04 errors fix (#25157) DEPR: remove assert_panel_equal (#25238) BUG: pandas Timestamp tz_localize and tz_convert do not preserve `freq` attribute (#25247) Revert "BLD: prevent asv from calling sys.stdin.close() by using different launch method (#25237)" (#25253) REF/TST: resample/test_base.py (#25262) BUG: Duplicated returns boolean dataframe (#25234) CLN: Remove ipython 2.x compat (#25150) Refactor groupby group_add from tempita to fused types (#24954) CLN: For loops, boolean conditions, misc. (#25206) (Closes #25029) Removed extra bracket from cheatsheet code example. (#25032) BLD: prevent asv from calling sys.stdin.close() by using different launch method (#25237) BUG: Fix read_json orient='table' without index (#25170) (#25171) BUG: Fix regression in DataFrame.apply causing RecursionError (#25230) BUG-25061 fix printing indices with NaNs (#25202) DEPR: Add Deprecated warning for timedelta with passed units M and Y (#23264) DEPR: Remove Panel-specific parts of io.pytables (#25233) DEPR: remove tm.makePanel and all usages (#25231)
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.
Great job, thanks for all the fixes. Just few comments.
pandas/core/algorithms.py
Outdated
If the input is an Index, the return is an Index | ||
If the input is a Categorical dtype, the return is a Categorical | ||
If the input is a Series/ndarray, the return will be an ndarray | ||
unique values |
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.
This should be the type, can you find out what's the returned Python type, and move this to the description please?
pandas/core/arrays/categorical.py
Outdated
Returns | ||
------- | ||
values : numpy array |
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.
values : numpy array | |
numpy.array |
pandas/core/arrays/categorical.py
Outdated
Returns | ||
------- | ||
values : numpy array |
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.
values : numpy array | |
numpy.array |
pandas/core/frame.py
Outdated
Returns | ||
------- | ||
value : scalar value | ||
scalar value |
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.
scalar value | |
scalar |
pandas/core/frame.py
Outdated
Returns | ||
------- | ||
sanitized_column : numpy-array | ||
numpy-array |
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.
numpy-array | |
numpy.array |
pandas/plotting/_core.py
Outdated
Returns | ||
------- | ||
axes : matplotlib.AxesSubplot histogram. | ||
matplotlib.AxesSubplot histogram. |
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.
Leave just the type, say it's a Histogram in the description.
pandas/plotting/_misc.py
Outdated
Returns | ||
------- | ||
ax : Matplotlib axis object | ||
Matplotlib axis object |
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.
Matplotlib axis object | |
class:`matplotlib.axes.Axes` |
There are many like this afterwards
pandas/plotting/_misc.py
Outdated
Returns | ||
------- | ||
ax: matplotlib axis object | ||
matplotlib axis object |
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.
matplotlib axis object | |
class:`matplotlib.axes.Axes` |
pandas/plotting/_misc.py
Outdated
Returns | ||
------- | ||
ax: Matplotlib axis object | ||
Matplotlib axis object |
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.
Matplotlib axis object | |
class:`matplotlib.axes.Axes` |
pandas/plotting/_misc.py
Outdated
Returns: | ||
----------- | ||
ax: Matplotlib axis object | ||
Matplotlib axis object |
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.
Matplotlib axis object | |
class:`matplotlib.axes.Axes` |
@datapythonista I think #25108 is already closed by #25309. Should I fix with your suggestions which are not covered by #25309? Or just close this PR and submit the new one? |
@thoo sorry didn't realize we had two PRs for this and other is already merged for RT05. Are there other elements to this outside of that you are trying to merge? |
pls merge master again |
* upstream/master: TST: xfail excel styler tests, xref GH25351 (#25352)
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 @thoo
ci/code_checks.sh
Outdated
|
||
MSG='Validate docstrings (GL06, GL07, GL09, SS04, PR03, PR05, PR10, EX04, RT04, RT05, SS05, SA05)' ; echo $MSG | ||
$BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,GL07,GL09,SS04,PR03,PR04,PR05,EX04,RT04,RT05,SS05,SA05 | ||
MSG='Validate docstrings (GL06, GL07, GL09, SS04, SS05, PR03, PR04, PR05, EX04, RT04, RT05, SA05)' ; echo $MSG |
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.
Was there a reason for removing PR10
here or just mistake?
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.
It is just a mistake from merge.
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.
PR10
is actually not included in the current check at line 245. So I wasn't sure someone exclude PR10
but forgot to remove from the message.
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.
Good catch. I think this was just missed in #25109 so makes sense to update here accordingly
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.
##[error]pandas/io/excel/_base.py(492,): error PR10: pandas.ExcelWriter: Parameter ".. versionadded" requires a space before the colon separating the parameter name and type
PR10 is not passing the check with Update pandas.ExcelWriter.. versionadded:: 0.24.
. I am going to leave PR10 for now.
pandas/core/series.py
Outdated
* Interval | ||
* Sparse | ||
* IntegerNA | ||
* IntegerNA . |
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've seen this on quite a few other requests. Nuanced but I'm personally of the opinion that this is a "hack" to pass validation so would prefer another route. Can you just add a one-line description after the bullet points instead?
* upstream/master: API: more consistent error message for MultiIndex.from_arrays (#25189) fix typo of see also in DataFrame stat funcs (#25388) edited whatsnew typo (#25381) REGR: fix TimedeltaIndex sum and datetime subtraction with NaT (#25282, #25317) (#25329) ENH: indexing and __getitem__ of dataframe and series accept zerodim integer np.array as int (#24924) [CLN] Excel Module Cleanups (#25275) Interval dtype fix (#25338) BUG/ENH: Timestamp.strptime (#25124) 14873: test for groupby.agg coercing booleans (#25327) [BUG] exception handling of MultiIndex.__contains__ too narrow (#25268) 9236: test for the DataFrame.groupby with MultiIndex having pd.NaT (#25310) #23049: test for Fatal Stack Overflow stemming From Misuse of astype('category') (#25366) Remove spurious MultiIndex creation in `_set_axis_name` (#25371) DOC: modify typos in Contributing section (#25365) DOC/BLD: fix --no-api option (#25209) DOC: Correct doc mistake in combiner func (#25360)
@thoo looking pretty good thanks for addressing comments. Can you update title to reflect what this PR is actually addressing, since it's no longer RT05? |
RT05
and check in CI RT05
and check in CI~ Clean up docstrings from functions related to RT05 errors
RT05
and check in CI~ Clean up docstrings from functions related to RT05 errorsThere 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.
Minor things but otherwise lgtm and thanks for updating title.
@datapythonista - some changes since your last approval do you mind taking a look again?
pandas/core/generic.py
Outdated
- If DataFrame.agg is called with several functions, returns | ||
a DataFrame. | ||
- If Series.agg is called with single function, returns a scalar. | ||
- If Series.agg is called with several functions, returns a Series. |
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.
Let's do the same thing you are doing below, where instead of putting periods at the end of each bullet you end with a short sentence after the bullets
pandas/core/algorithms.py
Outdated
- If the input is an Index, the return is an Index. | ||
- If the input is a Categorical dtype, the return is a Categorical. | ||
- If the input is a Series/ndarray, the return will be an ndarray. |
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.
Same comment here around periods for bullet points
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.
looks good, jut couple of comments more besides the ones already mentioned
pandas/core/indexes/base.py
Outdated
indexer, keyarr | ||
indexer is an ndarray or None if cannot convert | ||
keyarr are tuple-safe keys | ||
keyarr are tuple-safe keys. |
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.
do you mind documenting both parameters separately? It's done in other parts of this PR
pandas/io/excel/_base.py
Outdated
File mode to use (write or append). | ||
.. versionadded:: 0.24.0 | ||
File mode to use (write or append). .. versionadded:: 0.24.0 |
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.
is there a reason for this? Not sure if this will render correctly in the html
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.
Yeah, that's right. I was about to fix it.
* upstream/master: CLN: (re-)enable infer_dtype to catch complex (#25382)
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.
All good, just the Returns with the creative documenting of multiple values needs to be fixed
pandas/core/indexes/base.py
Outdated
- indexer : an ndarray or None if cannot convert | ||
- keyarr : tuple-safe keys | ||
Return indexer, keyarr. |
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.
Can you check in this diff the previous change? That's how a Return with multiple values is documented.
@thoo can you merge master and ping on green? |
* upstream/master: DOC: CategoricalIndex doc string (#24852) CI: add __init__.py to isort skip list (#25455) TST: numpy RuntimeWarning with Series.round() (#25432) DOC: fixed geo accessor example in extending.rst (#25420) BUG: fixed merging with empty frame containing an Int64 column (#25183) (#25289) TST: remove never-used singleton fixtures (#24885) PERF/REF: improve performance of Series.searchsorted, PandasArray.searchsorted, collect functionality (#22034) BUG: Indexing with UTC offset string no longer ignored (#25263) API/ERR: allow iterators in df.set_index & improve errors (#24984) DOC: Rewriting of ParserError doc + minor spacing (#25421) ENH: Add in sort keyword to DatetimeIndex.union (#25110) ERR: doc update for ParsingError (#25414) BUG: Fix type coercion in read_json orient='table' (#21345) (#25219) DEP: add pytest-mock to environment.yml (#25417) Correct a typo of version number for interpolate() (#25418) Mark test_pct_max_many_rows as high memory (#25400) DOC: Edited docstring of Interval (#25410)
@WillAyd All checks passed. |
Thanks @thoo ! |
closes Fix validation error typeRelated to Fix validation error typeRT05
and check in CI #25108RT05
and check in CI #25108 ,DOC: Fixes to docstrings and add PR10 (space before colon) to validation #25109./scripts/validate_docstrings.py --errors=RT05
)git diff upstream/master -u -- "*.py" | flake8 --diff