Skip to content

Commit

Permalink
Pin numpy to get ci back to green (#45179)
Browse files Browse the repository at this point in the history
  • Loading branch information
phofl committed Jan 4, 2022
1 parent a2aa477 commit 1696c0f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion environment.yml
Expand Up @@ -3,7 +3,7 @@ channels:
- conda-forge
dependencies:
# required
- numpy>=1.18.5
- numpy>=1.18.5, <1.22.0
- python=3.8
- python-dateutil>=2.8.1
- pytz
Expand Down
1 change: 1 addition & 0 deletions pandas/compat/numpy/__init__.py
Expand Up @@ -9,6 +9,7 @@
np_version_under1p19 = _nlv < Version("1.19")
np_version_under1p20 = _nlv < Version("1.20")
np_version_under1p22 = _nlv < Version("1.22")
np_version_is1p22 = _nlv == Version("1.22")
is_numpy_dev = _nlv.dev is not None
_min_numpy_ver = "1.18.5"

Expand Down
10 changes: 9 additions & 1 deletion pandas/tests/frame/test_ufunc.py
Expand Up @@ -3,6 +3,7 @@
import numpy as np
import pytest

from pandas.compat.numpy import np_version_is1p22
import pandas.util._test_decorators as td

import pandas as pd
Expand Down Expand Up @@ -252,7 +253,7 @@ def test_alignment_deprecation():


@td.skip_if_no("numba")
def test_alignment_deprecation_many_inputs():
def test_alignment_deprecation_many_inputs(request):
# https://github.com/pandas-dev/pandas/issues/39184
# test that the deprecation also works with > 2 inputs -> using a numba
# written ufunc for this because numpy itself doesn't have such ufuncs
Expand All @@ -261,6 +262,13 @@ def test_alignment_deprecation_many_inputs():
vectorize,
)

if np_version_is1p22:
mark = pytest.mark.xfail(
reason="ufunc 'my_ufunc' did not contain a loop with signature matching "
"types",
)
request.node.add_marker(mark)

This comment has been minimized.

Copy link
@johannes-mueller

johannes-mueller Mar 8, 2022

Contributor

This xfail seems not to occur in numpy-1.22.3 (see here)

@vectorize([float64(float64, float64, float64)])
def my_ufunc(x, y, z):
return x + y + z
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
@@ -1,7 +1,7 @@
# This file is auto-generated from environment.yml, do not modify.
# See that file for comments about the need/usage of each dependency.

numpy>=1.18.5
numpy>=1.18.5, <1.22.0
python-dateutil>=2.8.1
pytz
asv
Expand Down

0 comments on commit 1696c0f

Please sign in to comment.