Skip to content

Commit

Permalink
Skip NaT input on np.median test for np=1.21.
Browse files Browse the repository at this point in the history
As title. See: numpy/numpy#20376
  • Loading branch information
stuartarchibald committed Nov 16, 2021
1 parent 4df2640 commit 283bb98
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions numba/tests/test_array_reductions.py
Expand Up @@ -686,8 +686,12 @@ def _do_check_nptimedelta(self, pyfunc, arr):
np.random.shuffle(arr)
self.assertPreciseEqual(cfunc(arr), pyfunc(arr))
# Test with a NaT
arr[arr.size // 2] = 'NaT'
self.assertPreciseEqual(cfunc(arr), pyfunc(arr))
if numpy_version == (1, 21):
# There's problems with NaT handling on at least NumPy 1.21.{3, 4}
# See https://github.com/numpy/numpy/issues/20376
if 'median' not in pyfunc.__name__:
arr[arr.size // 2] = 'NaT'
self.assertPreciseEqual(cfunc(arr), pyfunc(arr))
if 'median' not in pyfunc.__name__:
# Test with (val, NaT)^N (and with the random NaT from above)
# use a loop, there's some weird thing/bug with arr[1::2] = 'NaT'
Expand Down

0 comments on commit 283bb98

Please sign in to comment.