-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DEPR: rename startingMonth
to starting_month
(argument in BQuarterBegin)
#58110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
You need to deprecate |
Thanks @Aloqeely ! Could you explain to me how I can deprecate |
Basically you should still allow |
pandas/_libs/tslibs/offsets.pyx
Outdated
|
||
def __init__(self, n=1, normalize=False, startingMonth=None): | ||
def __init__(self, n=1, normalize=False, starting_month=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yah, as @Aloqeely said, you'll want to do something like
def __init__(self, ..., startingMonth=no_default, *, starting_month=no_default):
if startingMonth is not no_default:
warnings.warn(...) # <- tell them to use starting_month instead
starting_month = startingMonth
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Brock, I changed it to the following:
def __init__(self, n=1, normalize=False, startingMonth=None,
*, starting_month=None):
if startingMonth is not None:
warnings.warn(
"`startingMonth` is deprecated and will be removed in a future "
"version. Use `starting_month` instead",
DeprecationWarning
)
starting_month = startingMonth
BaseOffset.__init__(self, n, normalize)
if starting_month is None:
starting_month = self._default_starting_month
self.starting_month = starting_month
Does this look right?
Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen. |
startingMonth
tostarting_month
(argument in BQuarterBegin) #57794doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.