Skip to content

BUG: hash_array TypeError instead of AttributeError on Index GH#42003 #45301

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

Merged
merged 4 commits into from
Jan 16, 2022

Conversation

jbrockmendel
Copy link
Member

@jreback jreback added this to the 1.5 milestone Jan 13, 2022
@jreback jreback added the Bug label Jan 13, 2022
raise TypeError(
"hash_array requires np.ndarray or ExtensionArray, not "
f"{type(vals).__name__}. Use hash_pandas_object instead."
)
elif not isinstance(vals, np.ndarray):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you instead check that this is an extension array and use an else clause?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

@jbrockmendel
Copy link
Member Author

updated + greenish

@jreback
Copy link
Contributor

jreback commented Jan 16, 2022

prob worth a whatsnew note as well here (followon fine)

@jreback jreback merged commit 5acb14b into pandas-dev:main Jan 16, 2022
@jbrockmendel jbrockmendel deleted the err-42003 branch January 16, 2022 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: 1.3.0rc1 pd.util.hash_array on Index fails to access _values_for_factorize
2 participants