Skip to content

Commit de89574

Browse files
committed
fix test_case
1 parent 3165efe commit de89574

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

pandas/tests/apply/test_frame_apply.py

+14-13
Original file line numberDiff line numberDiff line change
@@ -1720,17 +1720,18 @@ def test_agg_dist_like_and_nonunique_columns():
17201720
tm.assert_series_equal(result, expected)
17211721

17221722

1723-
def test_numba_raw_apply_with_args():
1724-
# GH:58712
1725-
df = DataFrame({"A": [1, 2, 3], "B": [4, 5, 6]})
1726-
result = df.apply(lambda x, a, b: x + a + b, args=(1, 2), engine="numba", raw=True)
1727-
# note:
1728-
# result is always float dtype, see core._numba.executor.py:generate_apply_looper
1729-
expected = df + 3.0
1730-
tm.assert_frame_equal(result, expected)
1723+
def test_numba_raw_apply_with_args(engine):
1724+
if engine == "numba":
1725+
# GH:58712
1726+
df = DataFrame({"A": [1, 2, 3], "B": [4, 5, 6]})
1727+
result = df.apply(lambda x, a, b: x + a + b, args=(1, 2), engine=engine, raw=True)
1728+
# note:
1729+
# result is always float dtype, see core._numba.executor.py:generate_apply_looper
1730+
expected = df + 3.0
1731+
tm.assert_frame_equal(result, expected)
17311732

1732-
with pytest.raises(
1733-
pd.errors.NumbaUtilError,
1734-
match="numba does not support kwargs with nopython=True",
1735-
):
1736-
df.apply(lambda x, a, b: x + a + b, args=(1,), b=2, engine="numba", raw=True)
1733+
with pytest.raises(
1734+
pd.errors.NumbaUtilError,
1735+
match="numba does not support kwargs with nopython=True",
1736+
):
1737+
df.apply(lambda x, a, b: x + a + b, args=(1,), b=2, engine=engine, raw=True)

0 commit comments

Comments
 (0)