Skip to content

Backport PR #55300 on branch 2.1.x (TST: xfail test due to new numexpr version) #55303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions pandas/tests/frame/test_arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@
)
import pandas._testing as tm
from pandas.core.computation import expressions as expr
from pandas.core.computation.expressions import (
_MIN_ELEMENTS,
NUMEXPR_INSTALLED,
)
from pandas.core.computation.expressions import _MIN_ELEMENTS
from pandas.tests.frame.common import (
_check_mixed_float,
_check_mixed_int,
)
from pandas.util.version import Version


@pytest.fixture(autouse=True, params=[0, 1000000], ids=["numexpr", "python"])
Expand Down Expand Up @@ -502,10 +500,19 @@ def test_floordiv_axis0(self):
result2 = df.floordiv(ser.values, axis=0)
tm.assert_frame_equal(result2, expected)

@pytest.mark.skipif(not NUMEXPR_INSTALLED, reason="numexpr not installed")
@pytest.mark.parametrize("opname", ["floordiv", "pow"])
def test_floordiv_axis0_numexpr_path(self, opname):
def test_floordiv_axis0_numexpr_path(self, opname, request):
# case that goes through numexpr and has to fall back to masked_arith_op
ne = pytest.importorskip("numexpr")
if (
Version(ne.__version__) >= Version("2.8.7")
and opname == "pow"
and "python" in request.node.callspec.id
):
request.node.add_marker(
pytest.mark.xfail(reason="https://github.com/pydata/numexpr/issues/454")
)

op = getattr(operator, opname)

arr = np.arange(_MIN_ELEMENTS + 100).reshape(_MIN_ELEMENTS // 100 + 1, -1) * 100
Expand Down