From acd8d02ca11081cf433ade9350dade3166b21618 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Thu, 6 Jul 2017 12:37:40 -0500 Subject: [PATCH] COMPAT: numpy 1.13 test compat (#16654) * COMPAT: numpy 1.13 test compat * CI: fix doc build to 1.12 (cherry picked from commit dc716b061d9a0bc6a59f4e02d72b9952cce28927) Did not include the change in `ci/requirements-3.6_DOC.build` fixing numpy to 1.12* --- pandas/compat/numpy/__init__.py | 3 +++ pandas/tests/test_expressions.py | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pandas/compat/numpy/__init__.py b/pandas/compat/numpy/__init__.py index 4a9a2647ece0f..2c5a18973afa8 100644 --- a/pandas/compat/numpy/__init__.py +++ b/pandas/compat/numpy/__init__.py @@ -15,6 +15,7 @@ _np_version_under1p11 = _nlv < '1.11' _np_version_under1p12 = _nlv < '1.12' _np_version_under1p13 = _nlv < '1.13' +_np_version_under1p14 = _nlv < '1.14' if _nlv < '1.7.0': raise ImportError('this version of pandas is incompatible with ' @@ -74,4 +75,6 @@ def np_array_datetime64_compat(arr, *args, **kwargs): '_np_version_under1p10', '_np_version_under1p11', '_np_version_under1p12', + '_np_version_under1p13', + '_np_version_under1p14' ] diff --git a/pandas/tests/test_expressions.py b/pandas/tests/test_expressions.py index fae7bfa513dcd..08c3a25e66b0e 100644 --- a/pandas/tests/test_expressions.py +++ b/pandas/tests/test_expressions.py @@ -13,7 +13,7 @@ from pandas.core.api import DataFrame, Panel from pandas.core.computation import expressions as expr -from pandas import compat, _np_version_under1p11 +from pandas import compat, _np_version_under1p11, _np_version_under1p13 from pandas.util.testing import (assert_almost_equal, assert_series_equal, assert_frame_equal, assert_panel_equal, assert_panel4d_equal, slow) @@ -420,6 +420,10 @@ def test_bool_ops_warn_on_arithmetic(self): f = getattr(operator, name) fe = getattr(operator, sub_funcs[subs[op]]) + # >= 1.13.0 these are now TypeErrors + if op == '-' and not _np_version_under1p13: + continue + with tm.use_numexpr(True, min_elements=5): with tm.assert_produces_warning(check_stacklevel=False): r = f(df, df)