Skip to content

CLN: Make offsets.BusinessHour.next_bday private#64715

Merged
mroeschke merged 3 commits intopandas-dev:mainfrom
tuhinsharma121:pandas.tseries.offsets.CustomBusinessHour.next_bday
Mar 20, 2026
Merged

CLN: Make offsets.BusinessHour.next_bday private#64715
mroeschke merged 3 commits intopandas-dev:mainfrom
tuhinsharma121:pandas.tseries.offsets.CustomBusinessHour.next_bday

Conversation

@tuhinsharma121
Copy link
Contributor

@tuhinsharma121 tuhinsharma121 commented Mar 19, 2026

Summary

  • Rename BusinessHour.next_bday to _next_bday since it is only used internally within the class and was never part of the public API.
  • The state.pop("next_bday", None) in __setstate__ is preserved for backward-compatible unpickling.

Test plan

  • Existing offset tests pass (no public usage of next_bday exists in tests or docs)

@tuhinsharma121 tuhinsharma121 marked this pull request as ready for review March 19, 2026 17:53
>>> pd.offsets.CustomBusinessHour(-2).next_bday
<-1 * CustomBusinessDay>
>>> pd.offsets.BusinessHour(1).next_bday
<BusinessDay>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t think this is all necessary. What if we just made the method private?

Copy link
Contributor Author

@tuhinsharma121 tuhinsharma121 Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've renamed it to _next_bday and reverted the docstring to the short form. The state.pop("next_bday", None) in __setstate__ is kept as-is for backward-compatible unpickling.

@tuhinsharma121 tuhinsharma121 changed the title DOC: Add docstring for offsets.BusinessHour.next_bday CLN: Make offsets.BusinessHour.next_bday private Mar 20, 2026
@mroeschke mroeschke added this to the 3.1 milestone Mar 20, 2026
@mroeschke mroeschke added the Frequency DateOffsets label Mar 20, 2026
@mroeschke mroeschke merged commit 9ec806b into pandas-dev:main Mar 20, 2026
45 checks passed
@mroeschke
Copy link
Member

Thanks @tuhinsharma121

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Frequency DateOffsets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants