Skip to content
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

CI/TST #34131 fixed test_floordiv_axis0_numexpr_path #34537

12 changes: 10 additions & 2 deletions pandas/tests/frame/test_arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
from pandas import DataFrame, MultiIndex, Series
import pandas._testing as tm
import pandas.core.common as com
from pandas.core.computation.expressions import (
_MIN_ELEMENTS,
_NUMEXPR_INSTALLED,
_USE_NUMEXPR,
)
from pandas.tests.frame.common import _check_mixed_float, _check_mixed_int

# -------------------------------------------------------------------
Expand Down Expand Up @@ -374,14 +379,17 @@ def test_floordiv_axis0(self):
result2 = df.floordiv(ser.values, axis=0)
tm.assert_frame_equal(result2, expected)

@pytest.mark.slow
@pytest.mark.parametrize("opname", ["floordiv", "pow"])
OlivierLuG marked this conversation as resolved.
Show resolved Hide resolved
def test_floordiv_axis0_numexpr_path(self, opname):
# case that goes through numexpr and has to fall back to masked_arith_op
op = getattr(operator, opname)

arr = np.arange(10 ** 6).reshape(100, -1)
OlivierLuG marked this conversation as resolved.
Show resolved Hide resolved
arr = np.arange(_MIN_ELEMENTS + 100).reshape(_MIN_ELEMENTS // 100 + 1, -1) * 100
df = pd.DataFrame(arr)
if _NUMEXPR_INSTALLED:
assert _USE_NUMEXPR
else:
return
df["C"] = 1.0

ser = df[0]
Expand Down