Skip to content

Commit 3fec908

Browse files
authored
DEPS: bump min numexpr version to 2.7.0 (#41558)
1 parent b04dad7 commit 3fec908

File tree

8 files changed

+8
-40
lines changed

8 files changed

+8
-40
lines changed

ci/deps/actions-37-minimum_versions.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dependencies:
1717
- bottleneck=1.2.1
1818
- jinja2=2.10
1919
- numba=0.46.0
20-
- numexpr=2.6.8
20+
- numexpr=2.7.0
2121
- numpy=1.17.3
2222
- openpyxl=3.0.0
2323
- pytables=3.5.1

doc/source/getting_started/install.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ Recommended dependencies
234234

235235
* `numexpr <https://github.com/pydata/numexpr>`__: for accelerating certain numerical operations.
236236
``numexpr`` uses multiple cores as well as smart chunking and caching to achieve large speedups.
237-
If installed, must be Version 2.6.8 or higher.
237+
If installed, must be Version 2.7.0 or higher.
238238

239239
* `bottleneck <https://github.com/pydata/bottleneck>`__: for accelerating certain types of ``nan``
240240
evaluations. ``bottleneck`` uses specialized cython routines to achieve large speedups. If installed,

doc/source/whatsnew/v1.3.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ If installed, we now require:
572572
+-----------------+-----------------+----------+---------+
573573
| bottleneck | 1.2.1 | | |
574574
+-----------------+-----------------+----------+---------+
575-
| numexpr | 2.6.8 | | |
575+
| numexpr | 2.7.0 | | X |
576576
+-----------------+-----------------+----------+---------+
577577
| pytest (dev) | 6.0 | | X |
578578
+-----------------+-----------------+----------+---------+

environment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ dependencies:
8181
- ipython>=7.11.1
8282
- jinja2<3.0.0 # pandas.Styler
8383
- matplotlib>=2.2.2 # pandas.plotting, Series.plot, DataFrame.plot
84-
- numexpr>=2.6.8
84+
- numexpr>=2.7.0
8585
- scipy>=1.2
8686
- numba>=0.46.0
8787

pandas/compat/_optional.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"gcsfs": "0.6.0",
1818
"lxml.etree": "4.3.0",
1919
"matplotlib": "2.2.3",
20-
"numexpr": "2.6.8",
20+
"numexpr": "2.7.0",
2121
"odfpy": "1.3.0",
2222
"openpyxl": "3.0.0",
2323
"pandas_gbq": "0.12.0",

pandas/core/computation/ops.py

+1-12
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
result_type_many,
2828
)
2929
from pandas.core.computation.scope import DEFAULT_GLOBALS
30-
from pandas.util.version import Version
3130

3231
from pandas.io.formats.printing import (
3332
pprint_thing,
@@ -616,18 +615,8 @@ def __repr__(self) -> str:
616615

617616
class FuncNode:
618617
def __init__(self, name: str):
619-
from pandas.core.computation.check import (
620-
NUMEXPR_INSTALLED,
621-
NUMEXPR_VERSION,
622-
)
623-
624-
if name not in MATHOPS or (
625-
NUMEXPR_INSTALLED
626-
and Version(NUMEXPR_VERSION) < Version("2.6.9")
627-
and name in ("floor", "ceil")
628-
):
618+
if name not in MATHOPS:
629619
raise ValueError(f'"{name}" is not a supported function')
630-
631620
self.name = name
632621
self.func = getattr(np, name)
633622

pandas/tests/computation/test_eval.py

+1-22
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
)
3030
import pandas._testing as tm
3131
from pandas.core.computation import pytables
32-
from pandas.core.computation.check import NUMEXPR_VERSION
3332
from pandas.core.computation.engines import (
3433
ENGINES,
3534
NumExprClobberingError,
@@ -51,7 +50,6 @@
5150
_binary_ops_dict,
5251
_unary_math_ops,
5352
)
54-
from pandas.util.version import Version
5553

5654

5755
@pytest.fixture(
@@ -76,20 +74,8 @@ def parser(request):
7674
return request.param
7775

7876

79-
@pytest.fixture
80-
def ne_lt_2_6_9():
81-
if NUMEXPR_INSTALLED and Version(NUMEXPR_VERSION) >= Version("2.6.9"):
82-
pytest.skip("numexpr is >= 2.6.9")
83-
return "numexpr"
84-
85-
8677
def _get_unary_fns_for_ne():
87-
if NUMEXPR_INSTALLED:
88-
if Version(NUMEXPR_VERSION) >= Version("2.6.9"):
89-
return list(_unary_math_ops)
90-
else:
91-
return [x for x in _unary_math_ops if x not in ["floor", "ceil"]]
92-
return []
78+
return list(_unary_math_ops) if NUMEXPR_INSTALLED else []
9379

9480

9581
@pytest.fixture(params=_get_unary_fns_for_ne())
@@ -1766,13 +1752,6 @@ def test_unary_functions(self, unary_fns_for_ne):
17661752
expect = getattr(np, fn)(a)
17671753
tm.assert_series_equal(got, expect, check_names=False)
17681754

1769-
@pytest.mark.parametrize("fn", ["floor", "ceil"])
1770-
def test_floor_and_ceil_functions_raise_error(self, ne_lt_2_6_9, fn):
1771-
msg = f'"{fn}" is not a supported function'
1772-
with pytest.raises(ValueError, match=msg):
1773-
expr = f"{fn}(100)"
1774-
self.eval(expr)
1775-
17761755
@pytest.mark.parametrize("fn", _binary_math_ops)
17771756
def test_binary_functions(self, fn):
17781757
df = DataFrame({"a": np.random.randn(10), "b": np.random.randn(10)})

requirements-dev.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ ipykernel
5353
ipython>=7.11.1
5454
jinja2<3.0.0
5555
matplotlib>=2.2.2
56-
numexpr>=2.6.8
56+
numexpr>=2.7.0
5757
scipy>=1.2
5858
numba>=0.46.0
5959
beautifulsoup4>=4.6.0

0 commit comments

Comments
 (0)