From ac37a18aedceaac3277e21d2b38b78599c5aa725 Mon Sep 17 00:00:00 2001 From: jbrockmendel Date: Tue, 11 Feb 2020 16:53:40 -0800 Subject: [PATCH] dont use numexpr where it wont help --- pandas/core/ops/__init__.py | 3 +-- pandas/tests/test_expressions.py | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pandas/core/ops/__init__.py b/pandas/core/ops/__init__.py index 0312c11a6d590..14af98c4ccc0e 100644 --- a/pandas/core/ops/__init__.py +++ b/pandas/core/ops/__init__.py @@ -375,7 +375,6 @@ def dispatch_to_series(left, right, func, str_rep=None, axis=None): """ # Note: we use iloc to access columns for compat with cases # with non-unique columns. - import pandas.core.computation.expressions as expressions right = lib.item_from_zerodim(right) if lib.is_scalar(right) or np.ndim(right) == 0: @@ -420,7 +419,7 @@ def column_op(a, b): # Remaining cases have less-obvious dispatch rules raise NotImplementedError(right) - new_data = expressions.evaluate(column_op, str_rep, left, right) + new_data = column_op(left, right) return new_data diff --git a/pandas/tests/test_expressions.py b/pandas/tests/test_expressions.py index fadab5d821470..d6560c6341021 100644 --- a/pandas/tests/test_expressions.py +++ b/pandas/tests/test_expressions.py @@ -95,7 +95,10 @@ def run_binary(self, df, other): expr.get_test_result() result = op(df, other) used_numexpr = expr.get_test_result() - assert used_numexpr, "Did not use numexpr as expected." + + # We don't currently use numexpr for comparisons in Series, + # so dont for DataFrame either. + assert not used_numexpr, "unexpectedly numexpr as expected." tm.assert_equal(expected, result) def run_frame(self, df, other, run_binary=True):