[BUG] Tests of ufuncs should ensure values are in the right domain #12352
Labels
0 - Backlog
In queue waiting for assignment
bug
Something isn't working
good first issue
Good for newcomers
tests
Unit testing for project
Describe the bug
The
test_array_ufunc.py
module contains tests that I introduced in #10346 and #10217 that are intended to be generic for all ufuncs intest_ufunc_(index|series|dataframe)
. However, the inputs are generated in exactly the same way for all ufuncs. This leads to some tests where all inputs are invalid, making some of the tests do nothing other than ensure that invalid inputs produce the same output. Some of the most egregious examples are inverse trigonometric functions arcsin and arccos, for which the domains are limited to (-1, 1) but all inputs are > 1.Steps/Code to reproduce bug
Run the tests and check warnings.
Expected behavior
The tests should be rewritten to generate inputs within the domain of the functions of choice, with perhaps just a few values outside the domain so that we can continue to validate consistent behavior in both cases. In an ideal world we would also update cudf to throw the same warnings as pandas here, but that may be more work than it's worth since we would almost certainly have to introspect the data.
The text was updated successfully, but these errors were encountered: