Repository: pandas-dev/pandas

Issue:
BLD: numpy 1.16.1 failing builds
looks like our builds are failing as we are now picking up numpy 1.16.1; I belive 1.16.2 fixes this, so once this is fully pushed should be ok.

These failures manifest with pytables. https://travis-ci.org/pandas-dev/pandas/jobs/500453356

cc @pandas-dev/pandas-core 

let's hold off merging for now / we could simply pin numpy=1.15.* as well (again for now), if someone wants to do this.


Discussion:
People were already noticing this issue back in #24839.
I understand, but our master builds just picked this up. I suspect because now all packages are actually available for numpy 1.16 (which wasn't the case before; this takes some time, esp in default)
@jreback : For sure.  I just wanted to link this issue to that one for reference.
`1.16.2` is available via the `conda-forge` <a href="https://anaconda.org/conda-forge/numpy">channel</a>

Resolving patch:
diff --git a/pandas/compat/numpy/__init__.py b/pandas/compat/numpy/__init__.py
--- a/pandas/compat/numpy/__init__.py
+++ b/pandas/compat/numpy/__init__.py
@@ -13,6 +13,7 @@
 _np_version_under1p14 = _nlv < LooseVersion('1.14')
 _np_version_under1p15 = _nlv < LooseVersion('1.15')
 _np_version_under1p16 = _nlv < LooseVersion('1.16')
+_np_version_under1p17 = _nlv < LooseVersion('1.17')
 
 
 if _nlv < '1.12':
@@ -66,5 +67,6 @@ def np_array_datetime64_compat(arr, *args, **kwargs):
            '_np_version_under1p13',
            '_np_version_under1p14',
            '_np_version_under1p15',
-           '_np_version_under1p16'
+           '_np_version_under1p16',
+           '_np_version_under1p17'
            ]


Test patch:
diff --git a/pandas/tests/indexes/multi/test_analytics.py b/pandas/tests/indexes/multi/test_analytics.py
--- a/pandas/tests/indexes/multi/test_analytics.py
+++ b/pandas/tests/indexes/multi/test_analytics.py
@@ -4,7 +4,7 @@
 import pytest
 
 from pandas.compat import PY2, lrange
-from pandas.compat.numpy import _np_version_under1p16
+from pandas.compat.numpy import _np_version_under1p17
 
 import pandas as pd
 from pandas import Index, MultiIndex, date_range, period_range
@@ -287,7 +287,7 @@ def test_numpy_ufuncs(idx, func):
     # test ufuncs of numpy. see:
     # http://docs.scipy.org/doc/numpy/reference/ufuncs.html
 
-    if _np_version_under1p16:
+    if _np_version_under1p17:
         expected_exception = AttributeError
         msg = "'tuple' object has no attribute '{}'".format(func.__name__)
     else:
diff --git a/pandas/tests/io/test_pytables.py b/pandas/tests/io/test_pytables.py
--- a/pandas/tests/io/test_pytables.py
+++ b/pandas/tests/io/test_pytables.py
@@ -34,6 +34,15 @@
 tables = pytest.importorskip('tables')
 
 
+# TODO:
+# remove when gh-24839 is fixed; this affects numpy 1.16
+# and pytables 3.4.4
+xfail_non_writeable = pytest.mark.xfail(
+    LooseVersion(np.__version__) >= LooseVersion('1.16'),
+    reason=('gh-25511, gh-24839. pytables needs a '
+            'release beyong 3.4.4 to support numpy 1.16x'))
+
+
 _default_compressor = ('blosc' if LooseVersion(tables.__version__) >=
                        LooseVersion('2.2') else 'zlib')
 
@@ -862,6 +871,7 @@ def test_put_integer(self):
         df = DataFrame(np.random.randn(50, 100))
         self._check_roundtrip(df, tm.assert_frame_equal)
 
+    @xfail_non_writeable
     def test_put_mixed_type(self):
         df = tm.makeTimeDataFrame()
         df['obj1'] = 'foo'
@@ -1438,7 +1448,10 @@ def test_to_hdf_with_min_itemsize(self):
             tm.assert_series_equal(pd.read_hdf(path, 'ss4'),
                                    pd.concat([df['B'], df2['B']]))
 
-    @pytest.mark.parametrize("format", ['fixed', 'table'])
+    @pytest.mark.parametrize(
+        "format",
+        [pytest.param('fixed', marks=xfail_non_writeable),
+         'table'])
     def test_to_hdf_errors(self, format):
 
         data = ['\ud800foo']
@@ -1815,6 +1828,7 @@ def test_pass_spec_to_storer(self):
             pytest.raises(TypeError, store.select,
                           'df', where=[('columns=A')])
 
+    @xfail_non_writeable
     def test_append_misc(self):
 
         with ensure_clean_store(self.path) as store:
@@ -2006,6 +2020,7 @@ def test_unimplemented_dtypes_table_columns(self):
             # this fails because we have a date in the object block......
             pytest.raises(TypeError, store.append, 'df_unimplemented', df)
 
+    @xfail_non_writeable
     @pytest.mark.skipif(
         LooseVersion(np.__version__) == LooseVersion('1.15.0'),
         reason=("Skipping  pytables test when numpy version is "
@@ -2245,6 +2260,7 @@ def test_float_index(self):
         s = Series(np.random.randn(10), index=index)
         self._check_roundtrip(s, tm.assert_series_equal)
 
+    @xfail_non_writeable
     def test_tuple_index(self):
 
         # GH #492
@@ -2257,6 +2273,7 @@ def test_tuple_index(self):
             simplefilter("ignore", pd.errors.PerformanceWarning)
             self._check_roundtrip(DF, tm.assert_frame_equal)
 
+    @xfail_non_writeable
     @pytest.mark.filterwarnings("ignore::pandas.errors.PerformanceWarning")
     def test_index_types(self):
 
@@ -2320,6 +2337,7 @@ def test_timeseries_preepoch(self):
         except OverflowError:
             pytest.skip('known failer on some windows platforms')
 
+    @xfail_non_writeable
     @pytest.mark.parametrize("compression", [
         False, pytest.param(True, marks=td.skip_if_windows_python_3)
     ])
@@ -2350,6 +2368,7 @@ def test_frame(self, compression):
         # empty
         self._check_roundtrip(df[:0], tm.assert_frame_equal)
 
+    @xfail_non_writeable
     def test_empty_series_frame(self):
         s0 = Series()
         s1 = Series(name='myseries')
@@ -2363,8 +2382,10 @@ def test_empty_series_frame(self):
         self._check_roundtrip(df1, tm.assert_frame_equal)
         self._check_roundtrip(df2, tm.assert_frame_equal)
 
-    def test_empty_series(self):
-        for dtype in [np.int64, np.float64, np.object, 'm8[ns]', 'M8[ns]']:
+    @xfail_non_writeable
+    @pytest.mark.parametrize(
+        'dtype', [np.int64, np.float64, np.object, 'm8[ns]', 'M8[ns]'])
+    def test_empty_series(self, dtype):
             s = Series(dtype=dtype)
             self._check_roundtrip(s, tm.assert_series_equal)
 
@@ -2445,6 +2466,7 @@ def test_store_series_name(self):
             recons = store['series']
             tm.assert_series_equal(recons, series)
 
+    @xfail_non_writeable
     @pytest.mark.parametrize("compression", [
         False, pytest.param(True, marks=td.skip_if_windows_python_3)
     ])
@@ -3954,6 +3976,7 @@ def test_pytables_native2_read(self, datapath):
             d1 = store['detector']
             assert isinstance(d1, DataFrame)
 
+    @xfail_non_writeable
     def test_legacy_table_fixed_format_read_py2(self, datapath):
         # GH 24510
         # legacy table with fixed format written in Python 2
@@ -4117,6 +4140,7 @@ def test_unicode_longer_encoded(self):
             result = store.get('df')
             tm.assert_frame_equal(result, df)
 
+    @xfail_non_writeable
     def test_store_datetime_mixed(self):
 
         df = DataFrame(
@@ -4677,6 +4701,7 @@ def test_complex_table(self):
             reread = read_hdf(path, 'df')
             assert_frame_equal(df, reread)
 
+    @xfail_non_writeable
     def test_complex_mixed_fixed(self):
         complex64 = np.array([1.0 + 1.0j, 1.0 + 1.0j,
                               1.0 + 1.0j, 1.0 + 1.0j], dtype=np.complex64)