@@ -96,14 +96,14 @@ def test_api_default_format(tmp_path, setup_path):
9696 assert store .get_storer ("df4" ).is_table
9797
9898
99- def test_put (setup_path , using_infer_string ):
99+ def test_put (setup_path ):
100100 with ensure_clean_store (setup_path ) as store :
101101 ts = Series (
102102 np .arange (10 , dtype = np .float64 ), index = date_range ("2020-01-01" , periods = 10 )
103103 )
104104 df = DataFrame (
105105 np .random .default_rng (2 ).standard_normal ((20 , 4 )),
106- columns = Index (list ("ABCD" ), dtype = object ),
106+ columns = Index (list ("ABCD" )),
107107 index = date_range ("2000-01-01" , periods = 20 , freq = "B" ),
108108 )
109109 store ["a" ] = ts
@@ -131,8 +131,6 @@ def test_put(setup_path, using_infer_string):
131131 # overwrite table
132132 store .put ("c" , df [:10 ], format = "table" , append = False )
133133 expected = df [:10 ]
134- if using_infer_string :
135- expected .columns = expected .columns .astype ("str" )
136134 result = store ["c" ]
137135 tm .assert_frame_equal (result , expected )
138136
@@ -163,18 +161,16 @@ def test_put_string_index(setup_path):
163161 tm .assert_frame_equal (store ["b" ], df )
164162
165163
166- def test_put_compression (setup_path , using_infer_string ):
164+ def test_put_compression (setup_path ):
167165 with ensure_clean_store (setup_path ) as store :
168166 df = DataFrame (
169167 np .random .default_rng (2 ).standard_normal ((10 , 4 )),
170- columns = Index (list ("ABCD" ), dtype = object ),
168+ columns = Index (list ("ABCD" )),
171169 index = date_range ("2000-01-01" , periods = 10 , freq = "B" ),
172170 )
173171
174172 store .put ("c" , df , format = "table" , complib = "zlib" )
175173 expected = df
176- if using_infer_string :
177- expected .columns = expected .columns .astype ("str" )
178174 result = store ["c" ]
179175 tm .assert_frame_equal (result , expected )
180176
@@ -185,10 +181,10 @@ def test_put_compression(setup_path, using_infer_string):
185181
186182
187183@td .skip_if_windows
188- def test_put_compression_blosc (setup_path , using_infer_string ):
184+ def test_put_compression_blosc (setup_path ):
189185 df = DataFrame (
190186 np .random .default_rng (2 ).standard_normal ((10 , 4 )),
191- columns = Index (list ("ABCD" ), dtype = object ),
187+ columns = Index (list ("ABCD" )),
192188 index = date_range ("2000-01-01" , periods = 10 , freq = "B" ),
193189 )
194190
@@ -200,16 +196,14 @@ def test_put_compression_blosc(setup_path, using_infer_string):
200196
201197 store .put ("c" , df , format = "table" , complib = "blosc" )
202198 expected = df
203- if using_infer_string :
204- expected .columns = expected .columns .astype ("str" )
205199 result = store ["c" ]
206200 tm .assert_frame_equal (result , expected )
207201
208202
209- def test_put_mixed_type (setup_path , performance_warning , using_infer_string ):
203+ def test_put_mixed_type (setup_path , performance_warning ):
210204 df = DataFrame (
211205 np .random .default_rng (2 ).standard_normal ((10 , 4 )),
212- columns = Index (list ("ABCD" ), dtype = object ),
206+ columns = Index (list ("ABCD" )),
213207 index = date_range ("2000-01-01" , periods = 10 , freq = "B" ),
214208 )
215209 df ["obj1" ] = "foo"
@@ -233,8 +227,6 @@ def test_put_mixed_type(setup_path, performance_warning, using_infer_string):
233227 store .put ("df" , df )
234228
235229 expected = df
236- if using_infer_string :
237- expected .columns = expected .columns .astype ("str" )
238230 result = store .get ("df" )
239231 tm .assert_frame_equal (result , expected )
240232
0 commit comments