-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Avoid importing from pandas at _libs files #31977
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
Avoid importing from pandas at _libs files #31977
Conversation
What is the benefit of doing this? I think I prefer it as is so we have only one way of testing for 32 bit |
@WillAyd TBH I don't really know, all I do know is that one time I imported |
@MomIsBestFriend is right that in general we try to avoid non-_libs imports in _libs, but that rule is not hard-and-fast, e.g. _libs.parsers is all over the place. tslibs is the only place where im really adamant about this. |
cdef: | ||
float64_t INF = <float64_t>np.inf | ||
float64_t NEGINF = -INF | ||
|
||
int64_t NPY_NAT = util.get_nat() | ||
|
||
bint is_32bit = is_platform_32bit() |
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 bint is_32bit = platform.architecture()[0] == "32-bit"
and avoid re-computing at runtime?
Unless there is a performance improvement I'd be -1 on this change |
what actually need is a cython version of compat that we can use; this is not what we are going for. |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
Something that brought at to me at first here
cc @jbrockmendel