-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REF: tighten what we accept in TimedeltaIndex._simple_new #31315
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
pandas/tests/resample/test_base.py
Outdated
@@ -106,7 +106,9 @@ def test_resample_empty_series(freq, empty_series, resample_method): | |||
if isinstance(s.index, PeriodIndex): | |||
expected.index = s.index.asfreq(freq=freq) | |||
else: | |||
expected.index = s.index._shallow_copy(freq=freq) | |||
idx = s.index |
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.
same comment as above, why not just collapse this so: s.index.asfreq(freq=freq)
or s.copy()
we don't need to have the shallow copy used like this in tests, nor work-arounds like 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.
implemented a helper _asfreq_compat for this, cleans up some code nicely
|
||
|
||
def _asfreq_compat(index, 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.
should this be in the indexes sub-tree?
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.
if we start using it elsewhere then we can move it. as long as its just here, id prefer to keep it private
gentle ping, id like to get this one in and move on to the PeriodArray and DTA counterparts |
thanks |
No description provided.