@@ -529,6 +529,7 @@ def test_hf_text_and_hf_hovertext():
529
529
def test_multiple_timezones ():
530
530
n = 5_050
531
531
532
+ # NOTE: date-range returns a (tz-aware) DatetimeIndex
532
533
dr = pd .date_range ("2022-02-14" , freq = "s" , periods = n , tz = "UTC" )
533
534
dr_v = np .random .randn (n )
534
535
@@ -538,6 +539,12 @@ def test_multiple_timezones():
538
539
dr .tz_convert ("Europe/Brussels" ),
539
540
dr .tz_convert ("Australia/Perth" ),
540
541
dr .tz_convert ("Australia/Canberra" ),
542
+ # NOTE: this pd.Series tests the functionality of a Pandas series with (tz-aware) DatetimeIndex
543
+ pd .Series (dr ),
544
+ pd .Series (dr .tz_localize (None ).tz_localize ("Europe/Amsterdam" )),
545
+ pd .Series (dr .tz_convert ("Europe/Brussels" )),
546
+ pd .Series (dr .tz_convert ("Australia/Perth" )),
547
+ pd .Series (dr .tz_convert ("Australia/Canberra" )),
541
548
]
542
549
543
550
plain_plotly_fig = make_subplots (rows = len (cs ), cols = 1 , shared_xaxes = True )
@@ -564,7 +571,7 @@ def test_multiple_timezones():
564
571
col = 1 ,
565
572
)
566
573
# Assert that the time parsing is exactly the same
567
- assert plain_plotly_fig .data [0 ].x [0 ] == fr_fig .data [0 ].x [0 ]
574
+ assert plain_plotly_fig .data [i - 1 ].x [0 ] == fr_fig .data [i - 1 ].x [0 ]
568
575
569
576
570
577
def test_datetime_hf_x_no_index ():
0 commit comments