-  
-   Notifications  You must be signed in to change notification settings 
- Fork 19.2k
PR04 errors fix #25157
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
PR04 errors fix #25157
Conversation
| Hello @mwoss! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on February 11, 2019 at 01:06 Hours UTC | 
| Codecov Report
 @@ Coverage Diff @@ ## master #25157 +/- ## =========================================== - Coverage 92.37% 42.86% -49.51%  =========================================== Files 166 166 Lines 52408 52408 =========================================== - Hits 48412 22467 -25945  - Misses 3996 29941 +25945
 
 Continue to review full report at Codecov. 
 | 
| Codecov Report
 @@ Coverage Diff @@ ## master #25157 +/- ## ========================================== - Coverage 92.15% 91.93% -0.23%  ========================================== Files 166 166 Lines 52294 52187 -107 ========================================== - Hits 48194 47978 -216  - Misses 4100 4209 +109
 
 Continue to review full report at Codecov. 
 | 
   pandas/core/generic.py  Outdated    
 | Returns | ||
| ------- | ||
| ---------- | 
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.
Why was this changed?
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 wasn't nacessary change, but I thought matching separator in every section will looks good.
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.
Please revert this - the length needs to match the title name for proper sphinx rendering
   pandas/io/parquet.py  Outdated    
 | behavior is to try 'pyarrow', falling back to 'fastparquet' if | ||
| 'pyarrow' is unavailable. | ||
| kwargs are passed to the engine | ||
| kwargs: Any additional kwargs are passed to the engine | 
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.
Need a space after kwargs here I think
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.
Fixed
   scripts/validate_docstrings.py  Outdated    
 | application.initialize(["--quiet"]) | ||
|  | ||
| with tempfile.NamedTemporaryFile(mode='w') as file: | ||
| with tempfile.NamedTemporaryFile(mode='w', encoding="utf-8") as file: | 
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.
Why are you changing this?
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.
Without strict encoding I had a problem with creating validation_errors json.
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 shouldn't be required here so please remove. If you are having some sort of issue without this please open as a separate issue
   pandas/core/groupby/grouper.py  Outdated    
 | ------- | ||
| A specification for a groupby instruction | ||
| Note | 
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.
What does this have to do with the PR04 error? Changes should really be limited to one thing at a time
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.
Line
additional kwargs to control time-like groupers (when
freqis passed)
was treated as parameter, so I had to move it somewhere else.
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.
Kwargs is a parameter so it belongs there
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.
Get rid of this section and just document kwargs as a parameter like everywhere else
   pandas/core/generic.py  Outdated    
 | ------- | ||
| ---------- | ||
| y : same as input | ||
| asdadasd | 
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.
Hmm?
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.
My bad, deleted.
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.
Please also post the output of the validation script for any docstrings changed here; I think some of the changes here are actually creating new issues so please be careful
   pandas/core/generic.py  Outdated    
 | Returns | ||
| ------- | ||
| ---------- | 
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.
Please revert this - the length needs to match the title name for proper sphinx rendering
   pandas/core/groupby/grouper.py  Outdated    
 | If grouper is PeriodIndex | ||
| base, loffset | ||
| base : int, default 0 | ||
| loffset : string / DateOffset / timedelta 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.
| loffset : string / DateOffset / timedelta object | |
| loffset : string, DateOffset, or timedelta | 
   pandas/core/groupby/grouper.py  Outdated    
 | ------- | ||
| A specification for a groupby instruction | ||
| Note | 
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.
Kwargs is a parameter so it belongs there
   pandas/core/generic.py  Outdated    
 | copy : boolean, default False | ||
| Make a copy of the underlying data. Mixed-dtype data will | ||
| always result in a copy | ||
| kwargs : Additional keyword arguments will be passed to the function | 
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.
There is a standard for args and kwargs so here you just want **kwargs on this line (no type require) and move the description down one line
   pandas/_libs/tslibs/timedeltas.pyx  Outdated    
 | 'ns', 'nanoseconds', 'nano', 'nanos', 'nanosecond', 'N'} | ||
| days, seconds, microseconds, | ||
| milliseconds, minutes, hours, weeks : numeric, optional | ||
| days,seconds,microseconds,milliseconds,minutes,hours,weeks : numeric, optional: | 
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.
Does this pass LINTing? May or may not be an issue just not aware of combining parameters like this into one line anywhere else
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.
Checked, there is one (only line to long atm), but I have no idea how to properly refactor that doc so PR04 error won't appear again
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.
Hmm OK. Technically the signature for this class only accepts **kwargs, so I would use that as the type and then move everything about days, seconds, etc... down into the descption
   pandas/core/panel.py  Outdated    
 | axis : {'items', 'minor', 'major'}, or {0, 1, 2}, or a tuple with two | ||
| axes | ||
| Additional keyword arguments will be passed as keywords to the function | ||
| kwargs : Additional keyword arguments will be passed to the function | 
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.
See above comment on kwargs
   pandas/core/panel.py  Outdated    
 | optional_mapper='', optional_axis='', optional_labels='') | ||
| _shared_doc_kwargs['args_transpose'] = ( | ||
| "three positional arguments: each one of\n{ax_single}".format( | ||
| "{ax_single}\n\tthree positional arguments from given options".format( | 
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.
How does this actually render? This doesn't appear to have a type so does this actually fix PR04?
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.
Yes, it does fix PR04 error.
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.
Hmm OK - somewhat surprised by that since I don't know what the type is. Keep in mind that Panel is deprecated so any changes to this module will probably be stripped out in next release anyway. So don't put too much more effort into these if you don't have to
   scripts/validate_docstrings.py  Outdated    
 | application.initialize(["--quiet"]) | ||
|  | ||
| with tempfile.NamedTemporaryFile(mode='w') as file: | ||
| with tempfile.NamedTemporaryFile(mode='w', encoding="utf-8") as file: | 
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 shouldn't be required here so please remove. If you are having some sort of issue without this please open as a separate issue
   pandas/io/parquet.py  Outdated    
 | behavior is to try 'pyarrow', falling back to 'fastparquet' if | ||
| 'pyarrow' is unavailable. | ||
| kwargs are passed to the engine | ||
| kwargs : Any additional kwargs are passed to the engine | 
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 on kwargs
   pandas/io/formats/style.py  Outdated    
 | `**kwargs` : Any additional keyword arguments are passed through | ||
| to ``self.template.render``. This is useful when you need to provide | ||
| additional variables for a custom template. | ||
| kwargs : Any additional keyword arguments | 
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 on kwargs
   pandas/_libs/tslibs/timedeltas.pyx  Outdated    
 | 'ns', 'nanoseconds', 'nano', 'nanos', 'nanosecond', 'N'} | ||
| days, seconds, microseconds, | ||
| milliseconds, minutes, hours, weeks : numeric, optional | ||
| days,seconds,microseconds,milliseconds,minutes,hours,weeks : numeric, optional: | 
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.
Hmm OK. Technically the signature for this class only accepts **kwargs, so I would use that as the type and then move everything about days, seconds, etc... down into the descption
   pandas/core/panel.py  Outdated    
 | optional_mapper='', optional_axis='', optional_labels='') | ||
| _shared_doc_kwargs['args_transpose'] = ( | ||
| "three positional arguments: each one of\n{ax_single}".format( | ||
| "{ax_single}\n\tthree positional arguments from given options".format( | 
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.
Hmm OK - somewhat surprised by that since I don't know what the type is. Keep in mind that Panel is deprecated so any changes to this module will probably be stripped out in next release anyway. So don't put too much more effort into these if you don't have to
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 post the output of the doctoring validation script every time you push going forward? I'm not sure these fixes are actually resolving issues without creating new ones, so having that output would be helpful
   pandas/core/groupby/grouper.py  Outdated    
 | ------- | ||
| A specification for a groupby instruction | ||
| Note | 
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.
Get rid of this section and just document kwargs as a parameter like everywhere else
| Should I post output as csv file, raw json or markdown table? | 
| You can just copy into comment.…  On Feb 6, 2019, at 4:29 PM, Mateusz Woś ***@***.***> wrote: Should I post output as csv file, raw json or markdown table? — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#25157 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAlOUUj0fJkC4U4re6jkhFSeoxu6w--Vks5vK3NugaJpZM4ajaGn>.  | 
| 
 | 
| I'll fix rest of the errors tomorrow | 
| Validation errors script output after update. 
 | 
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.
One comment then lgtm. @datapythonista do you mind taking a look?
   scripts/validate_docstrings.py  Outdated    
 | application.initialize(["--quiet"]) | ||
|  | ||
| with tempfile.NamedTemporaryFile(mode='w') as file: | ||
| with tempfile.NamedTemporaryFile(mode='w', encoding='utf-8') as file: | 
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.
If you can revert this I think the rest looks good
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.
Oh, i again commit this line. I should create github issue with coresponding PR for that.
   pandas/core/groupby/grouper.py  Outdated    
 | additional kwargs to control time-like groupers (when `freq` is passed) | ||
| closed : closed end of interval; 'left' or 'right' | ||
| Only when `freq` parameter is passed. | 
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.
Sorry just one last pass at all of these where Only when freq... is the description - not sure that's the best way of going about this.
It looks like the description for these is where the type should go. Can you move the description down to the line below and add a type for this and the 3 other parameters sharing this description? Also would be nice to revert removal of previous line if it doesn't cause PR04 failures
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.
What do you mean by sharing the description? Should I group those kwargs somehow?
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'll fix it in few hours. Sorry, busy weekend.
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 have no idea how deal with line below (for all kwargs).
Additional kwargs to control time-like groupers (when
freqis passed).
There is no description sharing functionality for Python docstrings.
| @WillAyd merge when good | 
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.
Just made one very minor tweak but otherwise lgtm. Ping on great and will merge
| @WillAyd all green :) | 
| thanks @mwoss | 
PR04and check in CI #25105git diff upstream/master -u -- "*.py" | flake8 --diffcode_check.shscript to take into account thePR04type of errors