@@ -96,14 +96,14 @@ def test_api_default_format(tmp_path, setup_path):
96
96
assert store .get_storer ("df4" ).is_table
97
97
98
98
99
- def test_put (setup_path , using_infer_string ):
99
+ def test_put (setup_path ):
100
100
with ensure_clean_store (setup_path ) as store :
101
101
ts = Series (
102
102
np .arange (10 , dtype = np .float64 ), index = date_range ("2020-01-01" , periods = 10 )
103
103
)
104
104
df = DataFrame (
105
105
np .random .default_rng (2 ).standard_normal ((20 , 4 )),
106
- columns = Index (list ("ABCD" ), dtype = object ),
106
+ columns = Index (list ("ABCD" )),
107
107
index = date_range ("2000-01-01" , periods = 20 , freq = "B" ),
108
108
)
109
109
store ["a" ] = ts
@@ -131,8 +131,6 @@ def test_put(setup_path, using_infer_string):
131
131
# overwrite table
132
132
store .put ("c" , df [:10 ], format = "table" , append = False )
133
133
expected = df [:10 ]
134
- if using_infer_string :
135
- expected .columns = expected .columns .astype ("str" )
136
134
result = store ["c" ]
137
135
tm .assert_frame_equal (result , expected )
138
136
@@ -163,18 +161,16 @@ def test_put_string_index(setup_path):
163
161
tm .assert_frame_equal (store ["b" ], df )
164
162
165
163
166
- def test_put_compression (setup_path , using_infer_string ):
164
+ def test_put_compression (setup_path ):
167
165
with ensure_clean_store (setup_path ) as store :
168
166
df = DataFrame (
169
167
np .random .default_rng (2 ).standard_normal ((10 , 4 )),
170
- columns = Index (list ("ABCD" ), dtype = object ),
168
+ columns = Index (list ("ABCD" )),
171
169
index = date_range ("2000-01-01" , periods = 10 , freq = "B" ),
172
170
)
173
171
174
172
store .put ("c" , df , format = "table" , complib = "zlib" )
175
173
expected = df
176
- if using_infer_string :
177
- expected .columns = expected .columns .astype ("str" )
178
174
result = store ["c" ]
179
175
tm .assert_frame_equal (result , expected )
180
176
@@ -185,10 +181,10 @@ def test_put_compression(setup_path, using_infer_string):
185
181
186
182
187
183
@td .skip_if_windows
188
- def test_put_compression_blosc (setup_path , using_infer_string ):
184
+ def test_put_compression_blosc (setup_path ):
189
185
df = DataFrame (
190
186
np .random .default_rng (2 ).standard_normal ((10 , 4 )),
191
- columns = Index (list ("ABCD" ), dtype = object ),
187
+ columns = Index (list ("ABCD" )),
192
188
index = date_range ("2000-01-01" , periods = 10 , freq = "B" ),
193
189
)
194
190
@@ -200,16 +196,14 @@ def test_put_compression_blosc(setup_path, using_infer_string):
200
196
201
197
store .put ("c" , df , format = "table" , complib = "blosc" )
202
198
expected = df
203
- if using_infer_string :
204
- expected .columns = expected .columns .astype ("str" )
205
199
result = store ["c" ]
206
200
tm .assert_frame_equal (result , expected )
207
201
208
202
209
- def test_put_mixed_type (setup_path , performance_warning , using_infer_string ):
203
+ def test_put_mixed_type (setup_path , performance_warning ):
210
204
df = DataFrame (
211
205
np .random .default_rng (2 ).standard_normal ((10 , 4 )),
212
- columns = Index (list ("ABCD" ), dtype = object ),
206
+ columns = Index (list ("ABCD" )),
213
207
index = date_range ("2000-01-01" , periods = 10 , freq = "B" ),
214
208
)
215
209
df ["obj1" ] = "foo"
@@ -233,8 +227,6 @@ def test_put_mixed_type(setup_path, performance_warning, using_infer_string):
233
227
store .put ("df" , df )
234
228
235
229
expected = df
236
- if using_infer_string :
237
- expected .columns = expected .columns .astype ("str" )
238
230
result = store .get ("df" )
239
231
tm .assert_frame_equal (result , expected )
240
232
0 commit comments