@@ -4349,25 +4349,28 @@ def test_query_with_nested_special_character(self):
4349
4349
tm .assert_frame_equal (expected , result )
4350
4350
4351
4351
def test_categorical (self ):
4352
- try :
4352
+ # FIXME
4353
+
4354
+ with ensure_clean_store (self .path ) as store :
4355
+
4353
4356
s = Series (Categorical (['a' , 'b' , 'b' , 'a' , 'a' , 'c' ], levels = ['a' ,'b' ,'c' ,'d' ]))
4354
- # FIXME: AttributeError: 'Categorical' object has no attribute 'T'
4355
- s .to_hdf (self .path , "cat_series_alone" )
4356
- s2 = read_hdf (self .path , "cat_series_alone" )
4357
- tm .assert_series_equal (s , s2 )
4357
+
4358
+ self .assertRaises (NotImplementedError , store .append , 's' , s , format = 'table' )
4359
+ #store.append('s', s, format='table')
4360
+ #result = store.select('s')
4361
+ #tm.assert_series_equal(s, result)
4362
+
4358
4363
df = DataFrame ({"s" :s , "vals" :[1 ,2 ,3 ,4 ,5 ,6 ]})
4359
- df .to_hdf (self .path , "cat_frame_alone" )
4360
- df2 = read_hdf (self .path , "cat_frame_alone" )
4361
- tm .assert_frame_equal (df , df2 )
4364
+ self .assertRaises (NotImplementedError , store .append , 'df' , df , format = 'table' )
4365
+ #store.append('df', df, format='table')
4366
+ #result = store.select('df')
4367
+ #tm.assert_frame_equal(df, df2)
4368
+
4362
4369
# Ok, this doesn't work yet
4363
4370
# FIXME: TypeError: cannot pass a where specification when reading from a Fixed format store. this store must be selected in its entirety
4364
- #result = read_hdf(hdf_file, "frame_alone" , where = ['index>2'])
4371
+ #result = store.select('df' , where = ['index>2'])
4365
4372
#tm.assert_frame_equal(df[df.index>2],result)
4366
4373
4367
- finally :
4368
- safe_remove (self .path )
4369
-
4370
-
4371
4374
def _test_sort (obj ):
4372
4375
if isinstance (obj , DataFrame ):
4373
4376
return obj .reindex (sorted (obj .index ))
0 commit comments