From 84dd879d193351a9fa6e2daa60ae010a923e8913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Kothe?= Date: Thu, 2 Oct 2025 19:23:59 -0300 Subject: [PATCH] fix: remove expected warnings for new `numexpr` version Remove expected warning for numexpr >=2.13.1. --- pandas/tests/frame/test_arithmetic.py | 11 ++++++++++- pandas/tests/series/test_arithmetic.py | 8 ++++++-- pandas/tests/test_expressions.py | 23 +++++++++++++++++------ 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/pandas/tests/frame/test_arithmetic.py b/pandas/tests/frame/test_arithmetic.py index a9a98a5005bb3..5e50759d34014 100644 --- a/pandas/tests/frame/test_arithmetic.py +++ b/pandas/tests/frame/test_arithmetic.py @@ -11,6 +11,8 @@ import numpy as np import pytest +from pandas.compat._optional import import_optional_dependency + import pandas as pd from pandas import ( DataFrame, @@ -24,6 +26,7 @@ _check_mixed_float, _check_mixed_int, ) +from pandas.util.version import Version @pytest.fixture @@ -1114,6 +1117,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 == "