Skip to content

Commit 6197e69

Browse files
committed
correct def get_start_end_field
1 parent 346457d commit 6197e69

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

pandas/_libs/tslibs/fields.pyx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,7 @@ def get_start_end_field(
253253
# month of year. Other offsets use month, startingMonth as ending
254254
# month of year.
255255

256-
if (freq_name.lstrip("B")[0:2] in ["MS", "QS", "YS"]) or (
257-
freq_name.lstrip("CB")[0:2] in ["MS", "QS", "YS"]):
256+
if freq_name[0:2] in ["MS", "QS", "YS"]:
258257
end_month = 12 if month_kw == 1 else month_kw - 1
259258
start_month = month_kw
260259
else:

pandas/tests/indexes/datetimes/test_scalar_compat.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,5 @@ def test_dti_is_year_start_freq_custom_business_day_with_digit(self):
345345
dr.is_year_start
346346

347347
def test_dti_is_year_start_freq_business_month_start_with(self):
348-
dr = date_range("2020-01-01", periods=1, freq="CBMS")
349-
print(dr.is_year_start)
350-
# assert all(dr.is_year_start)
348+
dr = date_range("2020-01-01", periods=1, freq="BMS")
349+
assert all(dr.is_year_start)

0 commit comments

Comments
 (0)