3434tables = pytest .importorskip ('tables' )
3535
3636
37+ # TODO:
38+ # remove when gh-24839 is fixed; this affects numpy 1.16
39+ # and pytables 3.4.4
40+ xfail_non_writeable = pytest .mark .xfail (
41+ LooseVersion (np .__version__ ) >= LooseVersion ('1.16' ),
42+ reason = ('gh-25511, gh-24839. pytables needs a '
43+ 'release beyong 3.4.4 to support numpy 1.16x' ))
44+
45+
3746_default_compressor = ('blosc' if LooseVersion (tables .__version__ ) >=
3847 LooseVersion ('2.2' ) else 'zlib' )
3948
@@ -875,6 +884,7 @@ def test_put_integer(self):
875884 df = DataFrame (np .random .randn (50 , 100 ))
876885 self ._check_roundtrip (df , tm .assert_frame_equal )
877886
887+ @xfail_non_writeable
878888 def test_put_mixed_type (self ):
879889 df = tm .makeTimeDataFrame ()
880890 df ['obj1' ] = 'foo'
@@ -1511,7 +1521,10 @@ def test_to_hdf_with_min_itemsize(self):
15111521 tm .assert_series_equal (pd .read_hdf (path , 'ss4' ),
15121522 pd .concat ([df ['B' ], df2 ['B' ]]))
15131523
1514- @pytest .mark .parametrize ("format" , ['fixed' , 'table' ])
1524+ @pytest .mark .parametrize (
1525+ "format" ,
1526+ [pytest .param ('fixed' , marks = xfail_non_writeable ),
1527+ 'table' ])
15151528 def test_to_hdf_errors (self , format ):
15161529
15171530 data = ['\ud800 foo' ]
@@ -1958,6 +1971,7 @@ def test_pass_spec_to_storer(self):
19581971 pytest .raises (TypeError , store .select ,
19591972 'df' , where = [('columns=A' )])
19601973
1974+ @xfail_non_writeable
19611975 def test_append_misc (self ):
19621976
19631977 with ensure_clean_store (self .path ) as store :
@@ -2189,6 +2203,7 @@ def test_unimplemented_dtypes_table_columns(self):
21892203 # this fails because we have a date in the object block......
21902204 pytest .raises (TypeError , store .append , 'df_unimplemented' , df )
21912205
2206+ @xfail_non_writeable
21922207 @pytest .mark .skipif (
21932208 LooseVersion (np .__version__ ) == LooseVersion ('1.15.0' ),
21942209 reason = ("Skipping pytables test when numpy version is "
@@ -2747,6 +2762,7 @@ def test_float_index(self):
27472762 s = Series (np .random .randn (10 ), index = index )
27482763 self ._check_roundtrip (s , tm .assert_series_equal )
27492764
2765+ @xfail_non_writeable
27502766 def test_tuple_index (self ):
27512767
27522768 # GH #492
@@ -2759,6 +2775,7 @@ def test_tuple_index(self):
27592775 simplefilter ("ignore" , pd .errors .PerformanceWarning )
27602776 self ._check_roundtrip (DF , tm .assert_frame_equal )
27612777
2778+ @xfail_non_writeable
27622779 @pytest .mark .filterwarnings ("ignore::pandas.errors.PerformanceWarning" )
27632780 def test_index_types (self ):
27642781
@@ -2822,6 +2839,7 @@ def test_timeseries_preepoch(self):
28222839 except OverflowError :
28232840 pytest .skip ('known failer on some windows platforms' )
28242841
2842+ @xfail_non_writeable
28252843 @pytest .mark .parametrize ("compression" , [
28262844 False , pytest .param (True , marks = td .skip_if_windows_python_3 )
28272845 ])
@@ -2852,6 +2870,7 @@ def test_frame(self, compression):
28522870 # empty
28532871 self ._check_roundtrip (df [:0 ], tm .assert_frame_equal )
28542872
2873+ @xfail_non_writeable
28552874 def test_empty_series_frame (self ):
28562875 s0 = Series ()
28572876 s1 = Series (name = 'myseries' )
@@ -2865,8 +2884,10 @@ def test_empty_series_frame(self):
28652884 self ._check_roundtrip (df1 , tm .assert_frame_equal )
28662885 self ._check_roundtrip (df2 , tm .assert_frame_equal )
28672886
2868- def test_empty_series (self ):
2869- for dtype in [np .int64 , np .float64 , np .object , 'm8[ns]' , 'M8[ns]' ]:
2887+ @xfail_non_writeable
2888+ @pytest .mark .parametrize (
2889+ 'dtype' , [np .int64 , np .float64 , np .object , 'm8[ns]' , 'M8[ns]' ])
2890+ def test_empty_series (self , dtype ):
28702891 s = Series (dtype = dtype )
28712892 self ._check_roundtrip (s , tm .assert_series_equal )
28722893
@@ -2947,6 +2968,7 @@ def test_store_series_name(self):
29472968 recons = store ['series' ]
29482969 tm .assert_series_equal (recons , series )
29492970
2971+ @xfail_non_writeable
29502972 @pytest .mark .parametrize ("compression" , [
29512973 False , pytest .param (True , marks = td .skip_if_windows_python_3 )
29522974 ])
@@ -4538,6 +4560,7 @@ def test_pytables_native2_read(self, datapath):
45384560 d1 = store ['detector' ]
45394561 assert isinstance (d1 , DataFrame )
45404562
4563+ @xfail_non_writeable
45414564 def test_legacy_table_fixed_format_read_py2 (self , datapath ):
45424565 # GH 24510
45434566 # legacy table with fixed format written in Python 2
@@ -4725,6 +4748,7 @@ def test_unicode_longer_encoded(self):
47254748 result = store .get ('df' )
47264749 tm .assert_frame_equal (result , df )
47274750
4751+ @xfail_non_writeable
47284752 def test_store_datetime_mixed (self ):
47294753
47304754 df = DataFrame (
@@ -5285,6 +5309,7 @@ def test_complex_table(self):
52855309 reread = read_hdf (path , 'df' )
52865310 assert_frame_equal (df , reread )
52875311
5312+ @xfail_non_writeable
52885313 def test_complex_mixed_fixed (self ):
52895314 complex64 = np .array ([1.0 + 1.0j , 1.0 + 1.0j ,
52905315 1.0 + 1.0j , 1.0 + 1.0j ], dtype = np .complex64 )
0 commit comments