Bug#1117200: pandas: Compatibility with numexpr v2.13
Antonio Valentino
antonio.valentino at tiscali.it
Sat Oct 4 17:45:06 BST 2025
Source: pandas
Version: 2.3.2+dfsg-2
Severity: normal
Tags: patch
X-Debbugs-Cc: antonio.valentino at tiscali.it
Dear Maintainer,
currently pandas is not compatible with numexpr >= v2.13 (already in
unstable).
The incompatibility is caused buy a change in the error type raised by
some invalid expressions in numexpr v2.13.
See https://github.com/PyTables/PyTables/pull/1256.
The issue has been fixed upstream.
See: https://github.com/pandas-dev/pandas/pull/62452.
I kindly ask to apply the attached patch (I can also open a merge
request on salsa if it is considered a better option).
-- System Information:
Debian Release: forky/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 6.14.0-33-generic (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: unable to detect
-------------- next part --------------
commit 179258fb8048999ba4cad675a7608f09fff88579
Author: Matthew Roeschke <10647082+mroeschke at users.noreply.github.com>
Date: Thu Sep 25 11:43:11 2025 -0700
TST: Adjust tests for numexpr 2.13 (#62452)
Index: pandas/pandas/tests/computation/test_eval.py
===================================================================
--- pandas.orig/pandas/tests/computation/test_eval.py
+++ pandas/pandas/tests/computation/test_eval.py
@@ -8,6 +8,7 @@ import numpy as np
import pytest
from pandas.compat import PY312
+from pandas.compat._optional import import_optional_dependency
from pandas.errors import (
NumExprClobberingError,
PerformanceWarning,
@@ -54,6 +55,9 @@ from pandas.core.computation.ops import
_unary_math_ops,
)
from pandas.core.computation.scope import DEFAULT_GLOBALS
+from pandas.util.version import Version
+
+numexpr = import_optional_dependency("numexpr", errors="ignore")
@pytest.fixture(
@@ -322,7 +326,9 @@ class TestEval:
def test_floor_division(self, lhs, rhs, engine, parser):
ex = "lhs // rhs"
- if engine == "python":
+ if engine == "python" or (
+ engine == "numexpr" and Version(numexpr.__version__) >= Version("2.13.0")
+ ):
res = pd.eval(ex, engine=engine, parser=parser)
expected = lhs // rhs
tm.assert_equal(res, expected)
@@ -393,7 +399,7 @@ class TestEval:
# int raises on numexpr
lhs = DataFrame(np.random.default_rng(2).integers(5, size=(5, 2)))
- if engine == "numexpr":
+ if engine == "numexpr" and Version(numexpr.__version__) < Version("2.13.0"):
msg = "couldn't find matching opcode for 'invert"
with pytest.raises(NotImplementedError, match=msg):
pd.eval(expr, engine=engine, parser=parser)
@@ -438,7 +444,7 @@ class TestEval:
# int raises on numexpr
lhs = Series(np.random.default_rng(2).integers(5, size=5))
- if engine == "numexpr":
+ if engine == "numexpr" and Version(numexpr.__version__) < Version("2.13.0"):
msg = "couldn't find matching opcode for 'invert"
with pytest.raises(NotImplementedError, match=msg):
pd.eval(expr, engine=engine, parser=parser)
More information about the debian-science-maintainers
mailing list