-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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: avoid runtime imports #27461
CLN: avoid runtime imports #27461
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.
any perf differences?
PR
master
Presumably anything that is caught by the |
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. @jreback any concerns?
i will look at things tomorrow |
pandas/util/_validators.py
Outdated
@@ -4,7 +4,7 @@ | |||
""" | |||
import warnings | |||
|
|||
from pandas.core.dtypes.common import is_bool | |||
from pandas._libs.lib import is_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.
this is the correct import; we really really don't want to import directly from .lib for things like this, these should always be from pandas.core.dtypes.common.
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.
this isn't a hill i want to die on, but the dependency structure consideration is that util._* are supposed to be "upstream" of core
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.
we don't enforce that in any way and this is a complete style break.
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.
ok, will change
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.
cool, ping on green.
ping |
thanks |
Edits to lib.is_scalar are to put slower python-space checks later so they may get short-circuited.
Everything else should be self-explanatory.