@@ -131,13 +131,18 @@ def test_resample_timedelta_values():
131
131
@pytest .mark .parametrize (
132
132
"start, end, freq, resample_freq" ,
133
133
[
134
- ("8H" , "21h59min " , "10S" , "3H" ),
134
+ ("8H" , "21h59min50s " , "10S" , "3H" ), # GH 30353 example
135
135
("3H" , "22H" , "1H" , "5H" ),
136
136
("527D" , "5006D" , "3D" , "10D" ),
137
+ ("1D" , "10D" , "1D" , "2D" ), # GH 13022 example
138
+ # tests that used to work before GH 33498:
139
+ ("8H" , "21h59min50s" , "10S" , "2H" ),
140
+ ("0H" , "21h59min50s" , "10S" , "3H" ),
141
+ ("10D" , "85D" , "D" , "2D" ),
137
142
],
138
143
)
139
144
def test_resample_timedelta_edge_case (start , end , freq , resample_freq ):
140
- # GH 30353
145
+ # GH 33498
141
146
# check that the timedelta bins does not contains an extra bin
142
147
idx = pd .timedelta_range (start = start , end = end , freq = freq )
143
148
s = pd .Series (np .arange (len (idx )), index = idx )
@@ -149,10 +154,17 @@ def test_resample_timedelta_edge_case(start, end, freq, resample_freq):
149
154
150
155
@pytest .mark .parametrize (
151
156
"start, end, freq" ,
152
- [("1day" , "10day" , "2D" ), ("2day" , "30day" , "3D" ), ("2s" , "50s" , "5s" )],
157
+ [
158
+ ("1D" , "10D" , "2D" ),
159
+ ("2D" , "30D" , "3D" ),
160
+ ("2s" , "50s" , "5s" ),
161
+ # tests that used to work before GH 33498:
162
+ ("4D" , "16D" , "3D" ),
163
+ ("8D" , "16D" , "40s" ),
164
+ ],
153
165
)
154
166
def test_timedelta_range_freq_divide_end (start , end , freq ):
155
- # GH 30353 only the cases where `(end % freq) == 0` used to fail
167
+ # GH 33498 only the cases where `(end % freq) == 0` used to fail
156
168
157
169
def mock_timedelta_range (start = None , end = None , ** kwargs ):
158
170
epoch = pd .Timestamp (0 )
0 commit comments