29
29
)
30
30
import pandas ._testing as tm
31
31
from pandas .core .computation import pytables
32
- from pandas .core .computation .check import NUMEXPR_VERSION
33
32
from pandas .core .computation .engines import (
34
33
ENGINES ,
35
34
NumExprClobberingError ,
51
50
_binary_ops_dict ,
52
51
_unary_math_ops ,
53
52
)
54
- from pandas .util .version import Version
55
53
56
54
57
55
@pytest .fixture (
@@ -76,20 +74,8 @@ def parser(request):
76
74
return request .param
77
75
78
76
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
-
86
77
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 []
93
79
94
80
95
81
@pytest .fixture (params = _get_unary_fns_for_ne ())
@@ -1766,13 +1752,6 @@ def test_unary_functions(self, unary_fns_for_ne):
1766
1752
expect = getattr (np , fn )(a )
1767
1753
tm .assert_series_equal (got , expect , check_names = False )
1768
1754
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
-
1776
1755
@pytest .mark .parametrize ("fn" , _binary_math_ops )
1777
1756
def test_binary_functions (self , fn ):
1778
1757
df = DataFrame ({"a" : np .random .randn (10 ), "b" : np .random .randn (10 )})
0 commit comments