CLN: avoid runtime imports#27461
Conversation
PR master Presumably anything that is caught by the |
TomAugspurger
left a comment
There was a problem hiding this comment.
LGTM. @jreback any concerns?
|
i will look at things tomorrow |
pandas/util/_validators.py
Outdated
| import warnings | ||
|
|
||
| from pandas.core.dtypes.common import is_bool | ||
| from pandas._libs.lib import is_bool |
There was a problem hiding this comment.
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.
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.
we don't enforce that in any way and this is a complete style break.
|
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.