-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
Merged
Merged
REF: remove BlockManager.set #33347
Changes from 7 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6691cad
REF: Remove BlockManager.set
jbrockmendel 17c42f8
Merge branch 'master' of https://github.com/pandas-dev/pandas into mg…
jbrockmendel 0e0a2d7
Merge branch 'master' of https://github.com/pandas-dev/pandas into mg…
jbrockmendel 2890ca0
Merge branch 'master' of https://github.com/pandas-dev/pandas into mg…
jbrockmendel 410ee6b
Merge branch 'master' of https://github.com/pandas-dev/pandas into mg…
jbrockmendel 439024f
Merge branch 'master' of https://github.com/pandas-dev/pandas into mg…
jbrockmendel 69dc163
Merge branch 'master' of https://github.com/pandas-dev/pandas into mg…
jbrockmendel 9a115d3
Merge branch 'master' of https://github.com/pandas-dev/pandas into mg…
jbrockmendel 1ac8fee
Merge branch 'master' of https://github.com/pandas-dev/pandas into mg…
jbrockmendel d5085cd
Merge branch 'master' of https://github.com/pandas-dev/pandas into mg…
jbrockmendel ff6a3db
Merge branch 'master' of https://github.com/pandas-dev/pandas into mg…
jbrockmendel eaeee8b
Merge branch 'master' of https://github.com/pandas-dev/pandas into mg…
jbrockmendel 5b97ed0
Merge branch 'master' of https://github.com/pandas-dev/pandas into mg…
jbrockmendel f9a1652
avoid need for clear kwarg
jbrockmendel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
|
||
@property | ||
def _is_cached(self) -> bool_t: | ||
|
@@ -3580,13 +3580,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 commentThe 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 commentThe 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 |
||
self._mgr.iset(loc, value) | ||
self._clear_item_cache() | ||
if clear: | ||
self._clear_item_cache() | ||
|
||
def _set_item(self, key, value) -> None: | ||
self._mgr.set(key, value) | ||
self._clear_item_cache() | ||
def _set_item(self, key, value, clear: bool_t = True) -> None: | ||
try: | ||
loc = self._info_axis.get_loc(key) | ||
except KeyError: | ||
# This item wasn't present, just insert at end | ||
self._mgr.insert(len(self._info_axis), key, value) | ||
return | ||
|
||
NDFrame._iset_item(self, loc, value, clear=clear) | ||
|
||
def _set_is_copy(self, ref, copy: bool_t = True) -> None: | ||
if not copy: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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