-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REF: remove BlockManager.set #33347
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
REF: remove BlockManager.set #33347
Conversation
pandas/core/generic.py
Outdated
@@ -3210,7 +3210,7 @@ def _maybe_cache_changed(self, item, value) -> None: | |||
""" | |||
The object has called back to us saying maybe it has changed. | |||
""" | |||
self._mgr.set(item, value) | |||
NDFrame._set_item(self, item, value, clear=False) |
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.
for my edification, why NDFrame?
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.
because we dont want to go through the DataFrame._set_item method
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.
are double underscore methods appropriate here for intraclass method calls? https://docs.python.org/3/tutorial/classes.html?highlight=mangle#private-variables
pandas/core/generic.py
Outdated
@@ -3589,13 +3589,20 @@ def _slice(self: FrameOrSeries, slobj: slice, axis=0) -> FrameOrSeries: | |||
result._set_is_copy(self, copy=is_copy) | |||
return result | |||
|
|||
def _iset_item(self, loc: int, value) -> None: | |||
def _iset_item(self, loc: int, value, clear: bool_t = True) -> 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.
where do we not clear?
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.
we get here via NDFrame._maybe_cache_changed.
These are pretty spaghetti-ish, looking forward to cleaning them out
updated to remove the need for |
thanks! |
xref #33052, #33332.
This touches several DataFrame/NDFrame methods. Those methods need a refactor in part because the ones defined on NDFrame are only ever called for DataFrame. Will refactor in follow-up.