-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
tm.assert_index_equal broken with pd.NA and np.NaT sentinel #31884
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
cc @jorisvandenbossche any thoughts on how to handle this? The
|
It's a general problem with how numpy handles the non-boolean result of comparing pd.NA:
Basically storing One possible solution for the specific case here of the asserts is adding a check for object dtype, and then specifically check the presence of pd.NA, that this presence is equal in both left and right, and then filter them out, and compare the remaining values. Another short-term quick workaround would also be to put the specific line in |
Looks like the comparison is a little better now. Could use a test
|
Hi, @mroeschke ! If I understand correctly, bug is fixed and there is needed test for checking |
Correct, @MrShevan. A unit test will need to be added to test that the code example still raises an exception |
Discovered in #31799
I couldn't reproduce this without using a np.* NaT sentinel...
The text was updated successfully, but these errors were encountered: