Skip to content

Commit db57aab

Browse files
committed
Fix the test by explicitly specifing engine
1 parent 1642cdb commit db57aab

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pandas/tests/computation/test_eval.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -737,12 +737,15 @@ def test_and_logic_string_match(self):
737737
assert pd.eval(f"{event.str.match('hello').a}")
738738
assert pd.eval(f"{event.str.match('hello').a and event.str.match('hello').a}")
739739

740-
def test_using_numpy(self):
740+
@pytest.mark.parametrize("engine", ["python", "numexpr"])
741+
def test_using_numpy(self, engine):
741742
# GH 58041
742743
df = Series([0.2, 1.5, 2.8], name="a").to_frame()
743-
res = df.eval("@np.floor(a)")
744+
res = df.eval("@np.floor(a)", engine=engine)
744745
expected = np.floor(df["a"])
745-
tm.assert_series_equal(expected, res, check_names=False)
746+
if engine == "numexpr":
747+
expected.name = None # See GH 58069
748+
tm.assert_series_equal(expected, res)
746749

747750

748751
# -------------------------------------

0 commit comments

Comments
 (0)