Skip to content

BUG: Catch TypeError in _is_dtype_type when converting abstract numpy types (#62018) #62030

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

abhaypsingh
Copy link

This prevents is_signed_integer_dtype and similar functions from raising on abstract NumPy classes and restores expected behaviour.

…#61781)

Replace reference to ``other`` with ``self`` in the generic mask/where docstring template so that the note correctly explains that misaligned index positions are filled based on alignment between `self` and `cond`, not `other` and `cond`. Fixes GH#61781.
DOC: Fix mask/where docstring to align with self and cond (pandas-dev#61781)
… type (pandas-dev#62018)

Wrap np.dtype() call in try/except to handle abstract numpy types like np.floating and return condition(type(None)) on TypeError.
@jbrockmendel
Copy link
Member

This is a small perf hit that will add up in a ton of places, all for something that we shouldn't expect to work anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: pd.api.types.is_signed_integer_dtype(np.floating) throws TypeError
2 participants