Skip to content

Commit dcb4e47

Browse files
committed
COMPAT: skip tests for numpy >= 1.12 with pow and integer inputs
closes pandas-dev#15363 CI: fix 3.5 build to numpy 1.11.3
1 parent 7713f29 commit dcb4e47

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
.noseids
2020
.ipynb_checkpoints
2121
.tags
22+
.cache/
2223

2324
# Compiled source #
2425
###################

ci/requirements-3.5.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
python-dateutil
22
pytz
3-
numpy
3+
numpy=1.11.3
44
cython

ci/requirements-3.5.run

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
python-dateutil
22
pytz
3-
numpy
3+
numpy=1.11.3
44
openpyxl
55
xlsxwriter
66
xlrd

pandas/tests/test_expressions.py

+16-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from pandas.core.api import DataFrame, Panel
1414
from pandas.computation import expressions as expr
15-
from pandas import compat
15+
from pandas import compat, _np_version_under1p12
1616
from pandas.util.testing import (assert_almost_equal, assert_series_equal,
1717
assert_frame_equal, assert_panel_equal,
1818
assert_panel4d_equal, slow)
@@ -78,6 +78,13 @@ def run_arithmetic_test(self, df, other, assert_func, check_dtype=False,
7878
if not compat.PY3:
7979
operations.append('div')
8080
for arith in operations:
81+
82+
# numpy >= 1.12 doesn't handle integers
83+
# raised to integer powers
84+
# https://github.com/pandas-dev/pandas/issues/15363
85+
if arith == 'pow' and not _np_version_under1p12:
86+
continue
87+
8188
operator_name = arith
8289
if arith == 'div':
8390
operator_name = 'truediv'
@@ -90,6 +97,7 @@ def run_arithmetic_test(self, df, other, assert_func, check_dtype=False,
9097
expr.set_use_numexpr(False)
9198
expected = op(df, other)
9299
expr.set_use_numexpr(True)
100+
93101
result = op(df, other)
94102
try:
95103
if check_dtype:
@@ -273,6 +281,13 @@ def testit():
273281

274282
for op, op_str in [('add', '+'), ('sub', '-'), ('mul', '*'),
275283
('div', '/'), ('pow', '**')]:
284+
285+
# numpy >= 1.12 doesn't handle integers
286+
# raised to integer powers
287+
# https://github.com/pandas-dev/pandas/issues/15363
288+
if op == 'pow' and not _np_version_under1p12:
289+
continue
290+
276291
if op == 'div':
277292
op = getattr(operator, 'truediv', None)
278293
else:

0 commit comments

Comments
 (0)