@@ -19,6 +19,9 @@ use serde::{Deserialize, Serialize};
1919use strum_macros:: IntoStaticStr ;
2020
2121use crate :: prelude:: * ;
22+ use crate :: windows:: window:: {
23+ duration_add_ms_dst_safe, duration_add_ns_dst_safe, duration_add_us_dst_safe,
24+ } ;
2225
2326#[ derive( Clone , Copy , Debug , PartialEq , Eq , Hash , IntoStaticStr ) ]
2427#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
@@ -257,9 +260,9 @@ pub(crate) fn group_by_values_iter_lookbehind(
257260 debug_assert ! ( offset. duration_ns( ) == period. duration_ns( ) ) ;
258261 debug_assert ! ( offset. negative) ;
259262 let add = match tu {
260- TimeUnit :: Nanoseconds => Duration :: add_ns ,
261- TimeUnit :: Microseconds => Duration :: add_us ,
262- TimeUnit :: Milliseconds => Duration :: add_ms ,
263+ TimeUnit :: Nanoseconds => duration_add_ns_dst_safe ,
264+ TimeUnit :: Microseconds => duration_add_us_dst_safe ,
265+ TimeUnit :: Milliseconds => duration_add_ms_dst_safe ,
263266 } ;
264267
265268 let upper_bound = upper_bound. unwrap_or ( time. len ( ) ) ;
@@ -338,9 +341,9 @@ pub(crate) fn group_by_values_iter_window_behind_t(
338341 tz : Option < Tz > ,
339342) -> impl TrustedLen < Item = PolarsResult < ( IdxSize , IdxSize ) > > + ' _ {
340343 let add = match tu {
341- TimeUnit :: Nanoseconds => Duration :: add_ns ,
342- TimeUnit :: Microseconds => Duration :: add_us ,
343- TimeUnit :: Milliseconds => Duration :: add_ms ,
344+ TimeUnit :: Nanoseconds => duration_add_ns_dst_safe ,
345+ TimeUnit :: Microseconds => duration_add_us_dst_safe ,
346+ TimeUnit :: Milliseconds => duration_add_ms_dst_safe ,
344347 } ;
345348
346349 let mut start = 0 ;
@@ -398,9 +401,9 @@ pub(crate) fn group_by_values_iter_partial_lookbehind(
398401 tz : Option < Tz > ,
399402) -> impl TrustedLen < Item = PolarsResult < ( IdxSize , IdxSize ) > > + ' _ {
400403 let add = match tu {
401- TimeUnit :: Nanoseconds => Duration :: add_ns ,
402- TimeUnit :: Microseconds => Duration :: add_us ,
403- TimeUnit :: Milliseconds => Duration :: add_ms ,
404+ TimeUnit :: Nanoseconds => duration_add_ns_dst_safe ,
405+ TimeUnit :: Microseconds => duration_add_us_dst_safe ,
406+ TimeUnit :: Milliseconds => duration_add_ms_dst_safe ,
404407 } ;
405408
406409 let mut start = 0 ;
@@ -459,9 +462,9 @@ pub(crate) fn group_by_values_iter_lookahead(
459462 let upper_bound = upper_bound. unwrap_or ( time. len ( ) ) ;
460463
461464 let add = match tu {
462- TimeUnit :: Nanoseconds => Duration :: add_ns ,
463- TimeUnit :: Microseconds => Duration :: add_us ,
464- TimeUnit :: Milliseconds => Duration :: add_ms ,
465+ TimeUnit :: Nanoseconds => duration_add_ns_dst_safe ,
466+ TimeUnit :: Microseconds => duration_add_us_dst_safe ,
467+ TimeUnit :: Milliseconds => duration_add_ms_dst_safe ,
465468 } ;
466469 let mut start = start_offset;
467470 let mut end = start;
@@ -866,9 +869,9 @@ impl RollingWindower {
866869 closed,
867870
868871 add : match tu {
869- TimeUnit :: Nanoseconds => Duration :: add_ns ,
870- TimeUnit :: Microseconds => Duration :: add_us ,
871- TimeUnit :: Milliseconds => Duration :: add_ms ,
872+ TimeUnit :: Nanoseconds => duration_add_ns_dst_safe ,
873+ TimeUnit :: Microseconds => duration_add_us_dst_safe ,
874+ TimeUnit :: Milliseconds => duration_add_ms_dst_safe ,
872875 } ,
873876 tz,
874877
@@ -1030,9 +1033,9 @@ impl GroupByDynamicWindower {
10301033 start_by,
10311034
10321035 add : match tu {
1033- TimeUnit :: Nanoseconds => Duration :: add_ns ,
1034- TimeUnit :: Microseconds => Duration :: add_us ,
1035- TimeUnit :: Milliseconds => Duration :: add_ms ,
1036+ TimeUnit :: Nanoseconds => duration_add_ns_dst_safe ,
1037+ TimeUnit :: Microseconds => duration_add_us_dst_safe ,
1038+ TimeUnit :: Milliseconds => duration_add_ms_dst_safe ,
10361039 } ,
10371040 nte : match tu {
10381041 TimeUnit :: Nanoseconds => Duration :: nte_duration_ns,
0 commit comments