@@ -15449,8 +15449,8 @@ def test_to_csv_date_format(self):
15449
15449
assert_frame_equal(test, nat_frame)
15450
15450
15451
15451
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:
15454
15454
# make sure we are not failing on transitions
15455
15455
times = pd.date_range("2013-10-26 23:00", "2013-10-27 01:00",
15456
15456
tz="Europe/London",
@@ -15468,6 +15468,25 @@ def test_to_csv_with_dst_transitions(self):
15468
15468
result.index = pd.to_datetime(result.index).tz_localize('UTC').tz_convert('Europe/London')
15469
15469
assert_frame_equal(result,df)
15470
15470
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
+
15471
15490
15472
15491
def test_concat_empty_dataframe_dtypes(self):
15473
15492
df = DataFrame(columns=list("abc"))
0 commit comments