From e6eb9f7077e59bf225914b9d501324fd69ff8e72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Kothe?= Date: Thu, 2 Oct 2025 21:43:47 -0300 Subject: [PATCH] Backport PR #62553: TST: remove expected warnings for new `numexpr` version (cherry picked from commit c8213d16d98079da2a7b7464b95fe22f7d72d427) --- pandas/tests/frame/test_arithmetic.py | 10 +++- pandas/tests/series/test_arithmetic.py | 8 ++- pandas/tests/test_expressions.py | 76 +++++++++++++++----------- 3 files changed, 60 insertions(+), 34 deletions(-) diff --git a/pandas/tests/frame/test_arithmetic.py b/pandas/tests/frame/test_arithmetic.py index 195126f1c5382..567183e45189e 100644 --- a/pandas/tests/frame/test_arithmetic.py +++ b/pandas/tests/frame/test_arithmetic.py @@ -12,6 +12,7 @@ import pytest from pandas.compat import HAS_PYARROW +from pandas.compat._optional import import_optional_dependency import pandas.util._test_decorators as td import pandas as pd @@ -27,6 +28,7 @@ _check_mixed_float, _check_mixed_int, ) +from pandas.util.version import Version @pytest.fixture @@ -1092,6 +1094,8 @@ def test_binop_other(self, op, value, dtype, switch_numexpr_min_elements): (operator.mod, "complex128"), } + ne = import_optional_dependency("numexpr", errors="ignore") + ne_warns_on_op = ne is not None and Version(ne.__version__) < Version("2.13.1") if (op, dtype) in invalid: warn = None if (dtype == "