Skip to content

Commit f788b9e

Browse files
committed
GH ref, remove redundant check
1 parent 82e9f8f commit f788b9e

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

doc/source/whatsnew/v2.0.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ Period
10281028
- Bug in :meth:`Period.strftime` and :meth:`PeriodIndex.strftime`, raising ``UnicodeDecodeError`` when a locale-specific directive was passed (:issue:`46319`)
10291029
- Bug in adding a :class:`Period` object to an array of :class:`DateOffset` objects incorrectly raising ``TypeError`` (:issue:`50162`)
10301030
- Bug in :class:`Period` where passing a string with finer resolution than nanosecond would result in a ``KeyError`` instead of dropping the extra precision (:issue:`50417`)
1031-
- Bug in parsing strings representing Week-periods e.g. "2017-01-23/2017-01-29" as minute-frequency instead of week-frequency (:issue:`??`)
1031+
- Bug in parsing strings representing Week-periods e.g. "2017-01-23/2017-01-29" as minute-frequency instead of week-frequency (:issue:`50803`)
10321032
-
10331033

10341034
Plotting

pandas/_libs/tslibs/period.pyx

+1-4
Original file line numberDiff line numberDiff line change
@@ -2686,10 +2686,7 @@ cdef parse_weekly_str(value, BaseOffset freq):
26862686
datetime-parsing logic. This ensures that we can round-trip with
26872687
Period.__str__ with weekly freq.
26882688
"""
2689-
match = re.search(r"^\d{4}-\d{2}-\d{2}/\d{4}-\d{2}-\d{2}", value)
2690-
if not match:
2691-
raise ValueError("Could not parse as weekly-freq Period")
2692-
2689+
# GH#50803
26932690
start, end = value.split("/")
26942691
start = Timestamp(start)
26952692
end = Timestamp(end)

pandas/tests/scalar/period/test_period.py

+1
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ def test_period_cons_weekly(self, num, day):
400400
assert isinstance(result, Period)
401401

402402
def test_parse_week_str_roundstrip(self):
403+
# GH#50803
403404
per = Period("2017-01-23/2017-01-29")
404405
assert per.freq.freqstr == "W-SUN"
405406

0 commit comments

Comments
 (0)