Skip to content

CLN: resolve DeprecationWarning in pandas/_testing.py #35942 #35943

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

Closed
wants to merge 1 commit into from

Conversation

fangchenli
Copy link
Member

@fangchenli fangchenli commented Aug 28, 2020

@fangchenli fangchenli changed the title CLN: resolve dep warning in _testing #35942 CLN: resolve DeprecationWarning in pandas/_testing.py #35942 Aug 28, 2020
@TomAugspurger
Copy link
Contributor

Thanks for the PR. Can you confirm that this is the correct fix? On master I see this

> /Users/taugspurger/sandbox/pandas/pandas/_testing.py(790)assert_index_equal()
-> diff = np.sum((left.values != right.values).astype(int)) * 100.0 / len(left)
(Pdb) left
Index([<NA>, NaT], dtype='object')
(Pdb) left.values
array([<NA>, numpy.datetime64('NaT')], dtype=object)
(Pdb) right.values
array([<NA>, NaT], dtype=object)
(Pdb) pp np.no
np.nonzero    np.not_equal
(Pdb) pp np.not_equal(left.values, right.values)
*** TypeError: boolean value of NA is ambiguous

Are we raising a TypeError but not seeing it since the test is xfailed?

@TomAugspurger TomAugspurger added the Testing pandas testing functions or related to the test suite label Sep 4, 2020
@fangchenli
Copy link
Member Author

Thanks for the PR. Can you confirm that this is the correct fix? On master I see this

> /Users/taugspurger/sandbox/pandas/pandas/_testing.py(790)assert_index_equal()
-> diff = np.sum((left.values != right.values).astype(int)) * 100.0 / len(left)
(Pdb) left
Index([<NA>, NaT], dtype='object')
(Pdb) left.values
array([<NA>, numpy.datetime64('NaT')], dtype=object)
(Pdb) right.values
array([<NA>, NaT], dtype=object)
(Pdb) pp np.no
np.nonzero    np.not_equal
(Pdb) pp np.not_equal(left.values, right.values)
*** TypeError: boolean value of NA is ambiguous

Are we raising a TypeError but not seeing it since the test is xfailed?

There are 4 xfail at pandas/tests/indexes/test_index_new.py:99. Before the change, it was an
AttributeError: 'bool' object has no attribute 'astype'. After the change, it became TypeError: boolean value of NA is ambiguous.

@TomAugspurger
Copy link
Contributor

Right, do we want that TypeError? What's the desired behavior?

@fangchenli
Copy link
Member Author

Right, do we want that TypeError? What's the desired behavior?

Not sure about this. Might need some discussion. xref #31884

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2020

This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Oct 5, 2020
@fangchenli fangchenli closed this Oct 5, 2020
@fangchenli fangchenli deleted the DepWarning-testing branch October 5, 2020 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CLN: DeprecationWarning in _testing
2 participants