-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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: General cleanup in _libs/lib.pyx
#33532
Conversation
pandas/_libs/lib.pyx
Outdated
@@ -287,6 +277,7 @@ def fast_unique_multiple(list arrays, sort: bool = True): | |||
try: | |||
uniques.sort() | |||
except TypeError: | |||
import warnings |
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.
Really unsure about this specific change, the reason I made this change is to avoid going through the python space for no reason, we are not getting into the except
block that often (that I know about).
pandas/_libs/lib.pyx
Outdated
from collections import abc | ||
from decimal import Decimal | ||
from fractions import Fraction | ||
from numbers import Number | ||
|
||
import sys | ||
import warnings | ||
|
||
import cython | ||
from cython import Py_ssize_t | ||
cimport cython | ||
from cython cimport Py_ssize_t |
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 import that are removed are:
from fractions import Fraction
from numbers import Number
import sys
Um... why? I try to be encouraging, but i dont see the point of any of this. |
You are doing a wonderful job :)
I'll remove the noise so you can see the actual changes. |
Much better, thanks. I think parsers.pyx has an unnecessary import of The lowest-hanging fruit for CLN PRs at this point is going through the tests and identifying giant tests that can be split into targeted tests. |
Looks good whenever green |
Thanks @MomIsBestFriend |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff