@@ -4877,13 +4877,26 @@ def test_read_nokey(self):
4877
4877
df = DataFrame (np .random .rand (4 , 5 ),
4878
4878
index = list ('abcd' ),
4879
4879
columns = list ('ABCDE' ))
4880
+ # Categorical dtype not supported for "fixed" format. So no need
4881
+ # to test for that.
4880
4882
with ensure_clean_path (self .path ) as path :
4881
4883
df .to_hdf (path , 'df' , mode = 'a' )
4882
4884
reread = read_hdf (path )
4883
4885
assert_frame_equal (df , reread )
4884
4886
df .to_hdf (path , 'df2' , mode = 'a' )
4885
4887
self .assertRaises (ValueError , read_hdf , path )
4886
4888
4889
+ def test_read_nokey_table (self ):
4890
+ # GH13231
4891
+ df = DataFrame ({'i' : range (5 ),
4892
+ 'c' : Series (list ('abacd' ), dtype = 'category' )})
4893
+ with ensure_clean_path (self .path ) as path :
4894
+ df .to_hdf (path , 'df' , mode = 'a' , format = 'table' )
4895
+ reread = read_hdf (path )
4896
+ assert_frame_equal (df , reread )
4897
+ df .to_hdf (path , 'df2' , mode = 'a' , format = 'table' )
4898
+ self .assertRaises (ValueError , read_hdf , path )
4899
+
4887
4900
def test_read_from_pathlib_path (self ):
4888
4901
4889
4902
# GH11773
0 commit comments