|
22 | 22 | )
|
23 | 23 | import pandas._testing as tm
|
24 | 24 | from pandas.core.computation import expressions as expr
|
25 |
| -from pandas.core.computation.expressions import ( |
26 |
| - _MIN_ELEMENTS, |
27 |
| - NUMEXPR_INSTALLED, |
28 |
| -) |
| 25 | +from pandas.core.computation.expressions import _MIN_ELEMENTS |
29 | 26 | from pandas.tests.frame.common import (
|
30 | 27 | _check_mixed_float,
|
31 | 28 | _check_mixed_int,
|
32 | 29 | )
|
| 30 | +from pandas.util.version import Version |
33 | 31 |
|
34 | 32 |
|
35 | 33 | @pytest.fixture(autouse=True, params=[0, 1000000], ids=["numexpr", "python"])
|
@@ -502,10 +500,19 @@ def test_floordiv_axis0(self):
|
502 | 500 | result2 = df.floordiv(ser.values, axis=0)
|
503 | 501 | tm.assert_frame_equal(result2, expected)
|
504 | 502 |
|
505 |
| - @pytest.mark.skipif(not NUMEXPR_INSTALLED, reason="numexpr not installed") |
506 | 503 | @pytest.mark.parametrize("opname", ["floordiv", "pow"])
|
507 |
| - def test_floordiv_axis0_numexpr_path(self, opname): |
| 504 | + def test_floordiv_axis0_numexpr_path(self, opname, request): |
508 | 505 | # case that goes through numexpr and has to fall back to masked_arith_op
|
| 506 | + ne = pytest.importorskip("numexpr") |
| 507 | + if ( |
| 508 | + Version(ne.__version__) >= Version("2.8.7") |
| 509 | + and opname == "pow" |
| 510 | + and "python" in request.node.callspec.id |
| 511 | + ): |
| 512 | + request.node.add_marker( |
| 513 | + pytest.mark.xfail(reason="https://github.com/pydata/numexpr/issues/454") |
| 514 | + ) |
| 515 | + |
509 | 516 | op = getattr(operator, opname)
|
510 | 517 |
|
511 | 518 | arr = np.arange(_MIN_ELEMENTS + 100).reshape(_MIN_ELEMENTS // 100 + 1, -1) * 100
|
|
0 commit comments