-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
PERF/DISC: restrict inputs to is_foo_dtype #33368
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
Comments
It'll be a bit of work, but we can define
And internally we use the strict |
Makes sense. Should keep the names public (no underscore, not in the public API), maybe some abbreviation |
Big +1 to deprecate passing values instead of dtypes. I am not sure it needs to hurt performance to include the deprecation? (as long as internally we change all occurrences to call this with a dtype of course). Right now, we eg have have this function to get the dtype: pandas/pandas/core/dtypes/common.py Lines 1594 to 1607 in 70086c5
So there is a check to see if the object has a "dtype" attribute. Adding a deprecation warning inside that if block shouldn't impact performance when passing dtypes to it? |
xref #33364
A lot of the overhead in is_foo_dtype (which we call a lot) comes from checking for dtype objects, arrays, and strings. We could tighten these to be e.g.
The trouble with this is some of these are user-facing, so this would require a deprecation cycle, and in the interim the
warnings
call would actually hurt performance.The text was updated successfully, but these errors were encountered: