-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REF: be stricter about what we pass to _simple_new #31055
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
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.
Big +1
@@ -420,7 +421,8 @@ def insert(self, loc, item): | |||
new_i8s = np.concatenate( | |||
(self[:loc].asi8, [item.view(np.int64)], self[loc:].asi8) | |||
) | |||
return self._shallow_copy(new_i8s, freq=freq) | |||
tda = type(self._data)._simple_new(new_i8s, freq=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.
doen't this copy twice?
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.
no, simple_new doesnt make a copy
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.
k, that's what i thought, can you (followup ok), document this loudly in the _simple_new
also I would document in simple_new what the copy guarantees are |
thanks, followon comments |
This will take a few passes to get rid of all the checks done in _simple_new that should be done elsewhere