Skip to content

Commit 83bc0a8

Browse files
committed
Attempt to fix CSV series roundtrip
1 parent 97f5de5 commit 83bc0a8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

pandas/tests/test_common.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -274,20 +274,20 @@ def test_dataframe_compression_defaults_to_infer(
274274
tm.assert_frame_equal(output, input)
275275

276276

277-
@pytest.mark.parametrize('write_method, read_method, read_kwargs', [
278-
('to_csv', pandas.Series.from_csv, {}),
279-
('to_json', pandas.read_json, {'typ': 'series'}),
280-
('to_pickle', pandas.read_pickle, {}),
277+
@pytest.mark.parametrize('write_method,write_kwargs,read_method,read_kwargs', [
278+
('to_csv', {'index': False, 'header': True}, pandas.read_csv, {'squeeze': True}),
279+
('to_json', {}, pandas.read_json, {'typ': 'series'}),
280+
('to_pickle', {}, pandas.read_pickle, {}),
281281
])
282282
def test_series_compression_defaults_to_infer(
283-
write_method, read_method, read_kwargs, compression_only):
283+
write_method, write_kwargs, read_method, read_kwargs, compression_only):
284284
# Test that Series.to_* methods default to inferring compression from
285285
# paths. https://github.com/pandas-dev/pandas/pull/22011
286-
input = Series(100 * [0, 5, -2, 10])
286+
input = Series([0, 5, -2, 10], name='X')
287287
extension = _compression_to_extension[compression_only]
288288
with tm.ensure_clean('compressed' + extension) as path:
289289
# assumes that compression='infer' is the default
290-
getattr(input, write_method)(path)
290+
getattr(input, write_method)(path, **write_kwargs)
291291
output = read_method(path, compression=compression_only, **read_kwargs)
292292
tm.assert_series_equal(output, input)
293293

0 commit comments

Comments
 (0)