-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
CLN: assorted cleanups, mostly post-black fixups #28857
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 @jbrockmendel! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2019-10-10 13:43:23 UTC |
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
@@ -1233,8 +1233,8 @@ class ErrorThread(threading.Thread): | |||
def run(self): | |||
try: | |||
super().run() | |||
except Exception as e: | |||
self.err = e | |||
except Exception as err: |
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 think you might have mentioned in the past but is there a flake8 rule for single character variable names? Worth turning on?
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.
IIRC there is a rule that excludes lower-case "l", upper-case "I", and upper-case "O" as ambiguous. My complaint about the more general case is that these are hard to grep for.
doc/make.py
Outdated
# may not be able to read the rst because it has some | ||
# sphinx specific stuff | ||
title = "this page" | ||
title = self._get_page_title(row[1]) |
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 you are changing this? Is the comment explaining it no longer true?
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.
looking to see in the CI if something more specific is raised
doc/source/whatsnew/v1.0.0.rst
Outdated
@@ -256,7 +256,7 @@ Timezones | |||
Numeric | |||
^^^^^^^ | |||
- Bug in :meth:`DataFrame.quantile` with zero-column :class:`DataFrame` incorrectly raising (:issue:`23925`) | |||
- :class:`DataFrame` inequality comparisons with object-dtype and ``complex`` entries failing to raise ``TypeError`` like their :class:`Series` counterparts (:issue:`28079`) | |||
- :class:`DataFrame` flex inequality comparisons with object-dtype and ``complex`` entries failing to raise ``TypeError`` like their :class:`Series` counterparts (:issue:`28079`) |
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.
Suggestion: use "flexible comparison methods such as ...
"
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 idea
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 do this one?
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.
updated
Opened an issue with black: psf/black#1051 |
doc/make.py
Outdated
@@ -206,15 +207,15 @@ def _add_redirects(self): | |||
|
|||
try: | |||
title = self._get_page_title(row[1]) | |||
except Exception: | |||
except docutils.io.InputError: |
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 don't think it is worth trying to pin down the exception, as explained in the comment below there are several cases where this may trigger an error. Why is that except Exception
that bad?
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 is that except Exception that bad?
In this docs file it is pretty benign, and the motivation is largely "because it shows up whenever I grep for 'except Exception'".
doc/source/whatsnew/v1.0.0.rst
Outdated
@@ -256,7 +256,7 @@ Timezones | |||
Numeric | |||
^^^^^^^ | |||
- Bug in :meth:`DataFrame.quantile` with zero-column :class:`DataFrame` incorrectly raising (:issue:`23925`) | |||
- :class:`DataFrame` inequality comparisons with object-dtype and ``complex`` entries failing to raise ``TypeError`` like their :class:`Series` counterparts (:issue:`28079`) | |||
- :class:`DataFrame` flex inequality comparisons with object-dtype and ``complex`` entries failing to raise ``TypeError`` like their :class:`Series` counterparts (:issue:`28079`) |
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 do this one?
doc/make.py
Outdated
@@ -206,15 +206,15 @@ def _add_redirects(self): | |||
|
|||
try: | |||
title = self._get_page_title(row[1]) | |||
except Exception: | |||
except (docutils.utils.SystemMessage, FileNotFoundError): |
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 understand that, but in this case I think it is better to keep the Exception
. We don't have proper tests for this, only one sphinx version and one docutils version on a clean doc build on Azure on one OS, but people can build the docs in many different ways in practice. I don't think we any guarantee that it will not give other errors there. And in this case it is also not a crucial part (like causing bugs in results) if we would swallow exceptions incorrectly.
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.
@jbrockmendel maybe revert 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.
reverted+green
Thanks! |
Mostly fixing extra " " introduced by black (will take a look at the issue tracker there to see if that can be fixed once and for all).
Also change
except Foo as e:
toexcept Foo as err
and remove oneexcept Exception
in a docs file. Clarified a whatsnew note that @jorisvandenbossche asked for a while back.