rapidsai/cudf

[BUG] Tests of ufuncs should ensure values are in the right domain

Open

#12352 opened on Dec 9, 2022

View on GitHub
 (1 comment) (0 reactions) (0 assignees)C++ (6,000 stars) (735 forks)batch import
0 - BacklogPythonbuggood first issuetests

Description

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 in test_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.

Contributor guide