@@ -10587,6 +10587,25 @@ def test_consolidate_datetime64(self):
10587
10587
assert_array_equal (df .starting .values , ser_starting .index .values )
10588
10588
assert_array_equal (df .ending .values , ser_ending .index .values )
10589
10589
10590
+ def test_tslib_tz_convert_trans_pos_plus_1__bug (self ):
10591
+ """
10592
+ Regression test for tslib.tz_convert(vals, tz1, tz2).
10593
+ See https://github.com/pydata/pandas/issues/4496 for details.
10594
+ """
10595
+ idx = pd .date_range (datetime (2011 , 3 , 26 , 23 ), datetime (2011 , 3 , 27 , 1 ), freq = '1min' )
10596
+ idx = idx .tz_localize ('UTC' )
10597
+ idx = idx .tz_convert ('Europe/Moscow' )
10598
+
10599
+ test_vector = pd .Series ([3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 ,
10600
+ 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 ,
10601
+ 3 , 3 , 3 , 3 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 ,
10602
+ 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 ,
10603
+ 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 5 ], dtype = int )
10604
+
10605
+ hours = idx .hour
10606
+
10607
+ np .testing .assert_equal (hours , test_vector .values )
10608
+
10590
10609
def _check_bool_op (self , name , alternative , frame = None , has_skipna = True ,
10591
10610
has_bool_only = False ):
10592
10611
if frame is None :
0 commit comments