@@ -15449,8 +15449,8 @@ def test_to_csv_date_format(self):
1544915449 assert_frame_equal(test, nat_frame)
1545015450
1545115451 def test_to_csv_with_dst_transitions(self):
15452- pname = '__tmp_to_csv_date_format_with_dst__'
15453- with ensure_clean(pname ) as path:
15452+
15453+ with ensure_clean('csv_date_format_with_dst' ) as path:
1545415454 # make sure we are not failing on transitions
1545515455 times = pd.date_range("2013-10-26 23:00", "2013-10-27 01:00",
1545615456 tz="Europe/London",
@@ -15468,6 +15468,25 @@ def test_to_csv_with_dst_transitions(self):
1546815468 result.index = pd.to_datetime(result.index).tz_localize('UTC').tz_convert('Europe/London')
1546915469 assert_frame_equal(result,df)
1547015470
15471+ # GH11619
15472+ idx = pd.date_range('2015-01-01', '2015-12-31', freq = 'H', tz='Europe/Paris')
15473+ df = DataFrame({'values' : 1, 'idx' : idx},
15474+ index=idx)
15475+ with ensure_clean('csv_date_format_with_dst') as path:
15476+ df.to_csv(path,index=True)
15477+ result = read_csv(path,index_col=0)
15478+ result.index = pd.to_datetime(result.index).tz_localize('UTC').tz_convert('Europe/Paris')
15479+ result['idx'] = pd.to_datetime(result['idx']).astype('datetime64[ns, Europe/Paris]')
15480+ assert_frame_equal(result,df)
15481+
15482+ # assert working
15483+ df.astype(str)
15484+
15485+ with ensure_clean('csv_date_format_with_dst') as path:
15486+ df.to_pickle(path)
15487+ result = pd.read_pickle(path)
15488+ assert_frame_equal(result,df)
15489+
1547115490
1547215491 def test_concat_empty_dataframe_dtypes(self):
1547315492 df = DataFrame(columns=list("abc"))
0 commit comments