-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
REF: Refactor reference handling to the BlockManager level for iterrows #51431
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/core/internals/managers.py
Outdated
@@ -247,6 +247,16 @@ def _has_no_reference_block(self, blkno: int) -> bool: | |||
""" | |||
return not self.blocks[blkno].refs.has_reference() | |||
|
|||
def add_references(self, mgr: BaseBlockManager) -> None: | |||
""" | |||
Adds the references from one manager to another. |
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.
This assumes an identical block structure between both managers?
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.
Yep, I’ll add a comment explaining 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.
Added
pandas/core/frame.py
Outdated
# Argument 1 to "add_references" of "BaseArrayManager" has incompatible | ||
# type "Union[BlockManager, ArrayManager]"; expected "BaseArrayManager" |
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.
To be honest, this is kind of bullshit .. (and just noise to add as a comment) There is no easy way to let mypy understand such typing with a base class?
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.
Theoretically we could make mypy aware that using_copy_on_write() guards agains ArrayManager, but I am not that familiar with mypy :)
Removed.
Merging, this was only a removed comment |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.let's see if this passes everything