Skip to content

Commit 5fdad9a

Browse files
committed
GH ref, remove redundant check
1 parent 008e5aa commit 5fdad9a

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
@@ -1069,7 +1069,7 @@ Period
10691069
- Bug in :meth:`Period.strftime` and :meth:`PeriodIndex.strftime`, raising ``UnicodeDecodeError`` when a locale-specific directive was passed (:issue:`46319`)
10701070
- Bug in adding a :class:`Period` object to an array of :class:`DateOffset` objects incorrectly raising ``TypeError`` (:issue:`50162`)
10711071
- 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`)
1072-
- Bug in parsing strings representing Week-periods e.g. "2017-01-23/2017-01-29" as minute-frequency instead of week-frequency (:issue:`??`)
1072+
- Bug in parsing strings representing Week-periods e.g. "2017-01-23/2017-01-29" as minute-frequency instead of week-frequency (:issue:`50803`)
10731073
-
10741074

10751075
Plotting

pandas/_libs/tslibs/period.pyx

+1-4
Original file line numberDiff line numberDiff line change
@@ -2684,10 +2684,7 @@ cdef parse_weekly_str(value, BaseOffset freq):
26842684
datetime-parsing logic. This ensures that we can round-trip with
26852685
Period.__str__ with weekly freq.
26862686
"""
2687-
match = re.search(r"^\d{4}-\d{2}-\d{2}/\d{4}-\d{2}-\d{2}", value)
2688-
if not match:
2689-
raise ValueError("Could not parse as weekly-freq Period")
2690-
2687+
# GH#50803
26912688
start, end = value.split("/")
26922689
start = Timestamp(start)
26932690
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)