Skip to content

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

Merged
merged 15 commits into from
Oct 11, 2019

Conversation

jbrockmendel
Copy link
Member

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: to except Foo as err and remove one except Exception in a docs file. Clarified a whatsnew note that @jorisvandenbossche asked for a while back.

@pep8speaks
Copy link

pep8speaks commented Oct 8, 2019

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

Copy link
Member

@WillAyd WillAyd left a 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:
Copy link
Member

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?

Copy link
Member Author

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.

@WillAyd WillAyd added the Clean label Oct 8, 2019
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])
Copy link
Member

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?

Copy link
Member Author

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

@@ -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`)
Copy link
Member

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 ..."

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea

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 do this one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@jbrockmendel
Copy link
Member Author

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:
Copy link
Member

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?

Copy link
Member Author

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'".

@@ -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`)
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 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):
Copy link
Member

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jbrockmendel maybe revert this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted+green

@jreback jreback added this to the 1.0 milestone Oct 11, 2019
@jorisvandenbossche jorisvandenbossche merged commit a31e160 into pandas-dev:master Oct 11, 2019
@jorisvandenbossche
Copy link
Member

Thanks!

@jbrockmendel jbrockmendel deleted the cln2 branch October 11, 2019 18:35
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
bongolegend pushed a commit to bongolegend/pandas that referenced this pull request Jan 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants