34
34
tables = pytest .importorskip ('tables' )
35
35
36
36
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
+
37
46
_default_compressor = ('blosc' if LooseVersion (tables .__version__ ) >=
38
47
LooseVersion ('2.2' ) else 'zlib' )
39
48
@@ -875,6 +884,7 @@ def test_put_integer(self):
875
884
df = DataFrame (np .random .randn (50 , 100 ))
876
885
self ._check_roundtrip (df , tm .assert_frame_equal )
877
886
887
+ @xfail_non_writeable
878
888
def test_put_mixed_type (self ):
879
889
df = tm .makeTimeDataFrame ()
880
890
df ['obj1' ] = 'foo'
@@ -1511,7 +1521,10 @@ def test_to_hdf_with_min_itemsize(self):
1511
1521
tm .assert_series_equal (pd .read_hdf (path , 'ss4' ),
1512
1522
pd .concat ([df ['B' ], df2 ['B' ]]))
1513
1523
1514
- @pytest .mark .parametrize ("format" , ['fixed' , 'table' ])
1524
+ @pytest .mark .parametrize (
1525
+ "format" ,
1526
+ [pytest .param ('fixed' , marks = xfail_non_writeable ),
1527
+ 'table' ])
1515
1528
def test_to_hdf_errors (self , format ):
1516
1529
1517
1530
data = ['\ud800 foo' ]
@@ -1958,6 +1971,7 @@ def test_pass_spec_to_storer(self):
1958
1971
pytest .raises (TypeError , store .select ,
1959
1972
'df' , where = [('columns=A' )])
1960
1973
1974
+ @xfail_non_writeable
1961
1975
def test_append_misc (self ):
1962
1976
1963
1977
with ensure_clean_store (self .path ) as store :
@@ -2189,6 +2203,7 @@ def test_unimplemented_dtypes_table_columns(self):
2189
2203
# this fails because we have a date in the object block......
2190
2204
pytest .raises (TypeError , store .append , 'df_unimplemented' , df )
2191
2205
2206
+ @xfail_non_writeable
2192
2207
@pytest .mark .skipif (
2193
2208
LooseVersion (np .__version__ ) == LooseVersion ('1.15.0' ),
2194
2209
reason = ("Skipping pytables test when numpy version is "
@@ -2747,6 +2762,7 @@ def test_float_index(self):
2747
2762
s = Series (np .random .randn (10 ), index = index )
2748
2763
self ._check_roundtrip (s , tm .assert_series_equal )
2749
2764
2765
+ @xfail_non_writeable
2750
2766
def test_tuple_index (self ):
2751
2767
2752
2768
# GH #492
@@ -2759,6 +2775,7 @@ def test_tuple_index(self):
2759
2775
simplefilter ("ignore" , pd .errors .PerformanceWarning )
2760
2776
self ._check_roundtrip (DF , tm .assert_frame_equal )
2761
2777
2778
+ @xfail_non_writeable
2762
2779
@pytest .mark .filterwarnings ("ignore::pandas.errors.PerformanceWarning" )
2763
2780
def test_index_types (self ):
2764
2781
@@ -2822,6 +2839,7 @@ def test_timeseries_preepoch(self):
2822
2839
except OverflowError :
2823
2840
pytest .skip ('known failer on some windows platforms' )
2824
2841
2842
+ @xfail_non_writeable
2825
2843
@pytest .mark .parametrize ("compression" , [
2826
2844
False , pytest .param (True , marks = td .skip_if_windows_python_3 )
2827
2845
])
@@ -2852,6 +2870,7 @@ def test_frame(self, compression):
2852
2870
# empty
2853
2871
self ._check_roundtrip (df [:0 ], tm .assert_frame_equal )
2854
2872
2873
+ @xfail_non_writeable
2855
2874
def test_empty_series_frame (self ):
2856
2875
s0 = Series ()
2857
2876
s1 = Series (name = 'myseries' )
@@ -2865,8 +2884,10 @@ def test_empty_series_frame(self):
2865
2884
self ._check_roundtrip (df1 , tm .assert_frame_equal )
2866
2885
self ._check_roundtrip (df2 , tm .assert_frame_equal )
2867
2886
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 ):
2870
2891
s = Series (dtype = dtype )
2871
2892
self ._check_roundtrip (s , tm .assert_series_equal )
2872
2893
@@ -2947,6 +2968,7 @@ def test_store_series_name(self):
2947
2968
recons = store ['series' ]
2948
2969
tm .assert_series_equal (recons , series )
2949
2970
2971
+ @xfail_non_writeable
2950
2972
@pytest .mark .parametrize ("compression" , [
2951
2973
False , pytest .param (True , marks = td .skip_if_windows_python_3 )
2952
2974
])
@@ -4538,6 +4560,7 @@ def test_pytables_native2_read(self, datapath):
4538
4560
d1 = store ['detector' ]
4539
4561
assert isinstance (d1 , DataFrame )
4540
4562
4563
+ @xfail_non_writeable
4541
4564
def test_legacy_table_fixed_format_read_py2 (self , datapath ):
4542
4565
# GH 24510
4543
4566
# legacy table with fixed format written in Python 2
@@ -4725,6 +4748,7 @@ def test_unicode_longer_encoded(self):
4725
4748
result = store .get ('df' )
4726
4749
tm .assert_frame_equal (result , df )
4727
4750
4751
+ @xfail_non_writeable
4728
4752
def test_store_datetime_mixed (self ):
4729
4753
4730
4754
df = DataFrame (
@@ -5285,6 +5309,7 @@ def test_complex_table(self):
5285
5309
reread = read_hdf (path , 'df' )
5286
5310
assert_frame_equal (df , reread )
5287
5311
5312
+ @xfail_non_writeable
5288
5313
def test_complex_mixed_fixed (self ):
5289
5314
complex64 = np .array ([1.0 + 1.0j , 1.0 + 1.0j ,
5290
5315
1.0 + 1.0j , 1.0 + 1.0j ], dtype = np .complex64 )
0 commit comments