-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REF: implement _with_freq, use _from_sequence less #32849
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
@@ -396,6 +396,34 @@ def floor(self, freq, ambiguous="raise", nonexistent="raise"): | |||
def ceil(self, freq, ambiguous="raise", nonexistent="raise"): | |||
return self._round(freq, RoundTo.PLUS_INFTY, ambiguous, nonexistent) | |||
|
|||
def _with_freq(self, freq): |
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.
can you type
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.
Optional[Union[Dateoffset, str]]
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.
returns Union[DTA,TDI,PA] (but I think we have a type for this)
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.
just tried this and it looks like its going to turn into a yak-shaving event, prefer to do that separately
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.
kk, followup if you can
thanks |
This makes method-chaining a little bit nicer.
Moving away from using _from_sequence and towards using the constructors where feasible. This will make it easier to stricten what we accept in these _from_sequence methods.
We also should be inferring freq less in arithmetic methods, but that is a behavior change that will be done separately.