Skip to content

Commit 82157fc

Browse files
committed
Add issue references
1 parent f932f51 commit 82157fc

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

pandas/tseries/frequencies.py

+1
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,7 @@ def _get_wom_rule(self):
935935
return None
936936

937937
week_of_months = unique((self.index.day - 1) // 7)
938+
# Only attempt to infer up to WOM-4. See #9425
938939
week_of_months = week_of_months[week_of_months < 4]
939940
if len(week_of_months) == 0 or len(week_of_months) > 1:
940941
return None

pandas/tseries/tests/test_frequencies.py

+2
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,12 @@ def test_week_of_month(self):
214214
self._check_generated_range('1/1/2000', 'WOM-%d%s' % (i, day))
215215

216216
def test_fifth_week_of_month(self):
217+
# Only supports freq up to WOM-4. See #9425
217218
func = lambda: date_range('2014-01-01', freq='WOM-5MON')
218219
self.assertRaises(ValueError, func)
219220

220221
def test_fifth_week_of_month_infer(self):
222+
# Only attempts to infer up to WOM-4. See #9425
221223
index = DatetimeIndex(["2014-03-31", "2014-06-30", "2015-03-30"])
222224
assert frequencies.infer_freq(index) is None
223225

0 commit comments

Comments
 (0)