Skip to content

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

2 participants