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
@@ -862,6 +871,7 @@ def test_put_integer(self):
862
871
df = DataFrame (np .random .randn (50 , 100 ))
863
872
self ._check_roundtrip (df , tm .assert_frame_equal )
864
873
874
+ @xfail_non_writeable
865
875
def test_put_mixed_type (self ):
866
876
df = tm .makeTimeDataFrame ()
867
877
df ['obj1' ] = 'foo'
@@ -1438,7 +1448,10 @@ def test_to_hdf_with_min_itemsize(self):
1438
1448
tm .assert_series_equal (pd .read_hdf (path , 'ss4' ),
1439
1449
pd .concat ([df ['B' ], df2 ['B' ]]))
1440
1450
1441
- @pytest .mark .parametrize ("format" , ['fixed' , 'table' ])
1451
+ @pytest .mark .parametrize (
1452
+ "format" ,
1453
+ [pytest .param ('fixed' , marks = xfail_non_writeable ),
1454
+ 'table' ])
1442
1455
def test_to_hdf_errors (self , format ):
1443
1456
1444
1457
data = ['\ud800 foo' ]
@@ -1815,6 +1828,7 @@ def test_pass_spec_to_storer(self):
1815
1828
pytest .raises (TypeError , store .select ,
1816
1829
'df' , where = [('columns=A' )])
1817
1830
1831
+ @xfail_non_writeable
1818
1832
def test_append_misc (self ):
1819
1833
1820
1834
with ensure_clean_store (self .path ) as store :
@@ -2006,6 +2020,7 @@ def test_unimplemented_dtypes_table_columns(self):
2006
2020
# this fails because we have a date in the object block......
2007
2021
pytest .raises (TypeError , store .append , 'df_unimplemented' , df )
2008
2022
2023
+ @xfail_non_writeable
2009
2024
@pytest .mark .skipif (
2010
2025
LooseVersion (np .__version__ ) == LooseVersion ('1.15.0' ),
2011
2026
reason = ("Skipping pytables test when numpy version is "
@@ -2245,6 +2260,7 @@ def test_float_index(self):
2245
2260
s = Series (np .random .randn (10 ), index = index )
2246
2261
self ._check_roundtrip (s , tm .assert_series_equal )
2247
2262
2263
+ @xfail_non_writeable
2248
2264
def test_tuple_index (self ):
2249
2265
2250
2266
# GH #492
@@ -2257,6 +2273,7 @@ def test_tuple_index(self):
2257
2273
simplefilter ("ignore" , pd .errors .PerformanceWarning )
2258
2274
self ._check_roundtrip (DF , tm .assert_frame_equal )
2259
2275
2276
+ @xfail_non_writeable
2260
2277
@pytest .mark .filterwarnings ("ignore::pandas.errors.PerformanceWarning" )
2261
2278
def test_index_types (self ):
2262
2279
@@ -2320,6 +2337,7 @@ def test_timeseries_preepoch(self):
2320
2337
except OverflowError :
2321
2338
pytest .skip ('known failer on some windows platforms' )
2322
2339
2340
+ @xfail_non_writeable
2323
2341
@pytest .mark .parametrize ("compression" , [
2324
2342
False , pytest .param (True , marks = td .skip_if_windows_python_3 )
2325
2343
])
@@ -2350,6 +2368,7 @@ def test_frame(self, compression):
2350
2368
# empty
2351
2369
self ._check_roundtrip (df [:0 ], tm .assert_frame_equal )
2352
2370
2371
+ @xfail_non_writeable
2353
2372
def test_empty_series_frame (self ):
2354
2373
s0 = Series ()
2355
2374
s1 = Series (name = 'myseries' )
@@ -2363,8 +2382,10 @@ def test_empty_series_frame(self):
2363
2382
self ._check_roundtrip (df1 , tm .assert_frame_equal )
2364
2383
self ._check_roundtrip (df2 , tm .assert_frame_equal )
2365
2384
2366
- def test_empty_series (self ):
2367
- for dtype in [np .int64 , np .float64 , np .object , 'm8[ns]' , 'M8[ns]' ]:
2385
+ @xfail_non_writeable
2386
+ @pytest .mark .parametrize (
2387
+ 'dtype' , [np .int64 , np .float64 , np .object , 'm8[ns]' , 'M8[ns]' ])
2388
+ def test_empty_series (self , dtype ):
2368
2389
s = Series (dtype = dtype )
2369
2390
self ._check_roundtrip (s , tm .assert_series_equal )
2370
2391
@@ -2445,6 +2466,7 @@ def test_store_series_name(self):
2445
2466
recons = store ['series' ]
2446
2467
tm .assert_series_equal (recons , series )
2447
2468
2469
+ @xfail_non_writeable
2448
2470
@pytest .mark .parametrize ("compression" , [
2449
2471
False , pytest .param (True , marks = td .skip_if_windows_python_3 )
2450
2472
])
@@ -3954,6 +3976,7 @@ def test_pytables_native2_read(self, datapath):
3954
3976
d1 = store ['detector' ]
3955
3977
assert isinstance (d1 , DataFrame )
3956
3978
3979
+ @xfail_non_writeable
3957
3980
def test_legacy_table_fixed_format_read_py2 (self , datapath ):
3958
3981
# GH 24510
3959
3982
# legacy table with fixed format written in Python 2
@@ -4117,6 +4140,7 @@ def test_unicode_longer_encoded(self):
4117
4140
result = store .get ('df' )
4118
4141
tm .assert_frame_equal (result , df )
4119
4142
4143
+ @xfail_non_writeable
4120
4144
def test_store_datetime_mixed (self ):
4121
4145
4122
4146
df = DataFrame (
@@ -4677,6 +4701,7 @@ def test_complex_table(self):
4677
4701
reread = read_hdf (path , 'df' )
4678
4702
assert_frame_equal (df , reread )
4679
4703
4704
+ @xfail_non_writeable
4680
4705
def test_complex_mixed_fixed (self ):
4681
4706
complex64 = np .array ([1.0 + 1.0j , 1.0 + 1.0j ,
4682
4707
1.0 + 1.0j , 1.0 + 1.0j ], dtype = np .complex64 )
0 commit comments