-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
CLN: collect fastpath in Series.__init__ #49575
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
# skips validation of the name | ||
object.__setattr__(self, "_name", name) | ||
NDFrame.__init__(self, data) | ||
return |
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.
fastpath now ends here and everything below can simply be moved one level to the left.
The failed check seems unrelated. |
@@ -378,103 +377,99 @@ def __init__( | |||
data = SingleArrayManager.from_array(data, index) | |||
if copy: | |||
data = data.copy() | |||
if index is 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.
Why is this if index is None:
check no longer needed in the fastpath
?
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 you follow the code all the way down to the end of the method you can see that this actually is a noop; It's superflous code and can be removed. It was just difficult to see in the old code.
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.
Ah okay I see it now. Thanks
Thanks @topper-123 |
* CLN: collect fastpath in Series.__init__ * small clean Co-authored-by: Terji Petersen <[email protected]>
* CLN: collect fastpath in Series.__init__ * small clean Co-authored-by: Terji Petersen <[email protected]>
* CLN: collect fastpath in Series.__init__ * small clean Co-authored-by: Terji Petersen <[email protected]>
Collect fastpath functionality in one place simplifies implementation