-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
CLN: misc cleanups #30877
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
CLN: misc cleanups #30877
Conversation
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.
minor comment otherwise lgtm
pandas/core/arrays/categorical.py
Outdated
@@ -2279,7 +2279,7 @@ def _from_factorized(cls, uniques, original): | |||
original.categories.take(uniques), dtype=original.dtype | |||
) | |||
|
|||
def equals(self, other): | |||
def equals(self, other) -> bool: |
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.
def equals(self, other) -> bool: | |
def equals(self, other: Any) -> bool: |
Purely stylistic but we've been typing other
as Any elsewhere, so good to do here as well (applicable in a few spots)
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.
the docstring says other is Categorical; id prefer not to introduce mismatches
reverted annotations to push the other parts down the field |
@WillAyd gentle ping; reverted the parts that were non-trivial |
Thanks @jbrockmendel |
except (KeyError, TypeError, ValueError): | ||
return False | ||
return bool( |
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.
isn't the bool redundant here?
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.
not according to mypy
Things I find myself doing in multiple branches.