-
-
Notifications
You must be signed in to change notification settings - Fork 19.1k
REGR: Fix inplace updates on column to set correct values #35936
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -1027,6 +1027,8 @@ def iset(self, loc: Union[int, slice, np.ndarray], value): | |||||||||||||
Set new item in-place. Does not consolidate. Adds new Block if not | ||||||||||||||
contained in the current set of items | ||||||||||||||
""" | ||||||||||||||
if isinstance(value, ABCSeries): | ||||||||||||||
value = value._values | ||||||||||||||
|
def _maybe_cache_changed(self, item, value) -> None: | |
""" | |
The object has called back to us saying maybe it has changed. | |
""" | |
loc = self._info_axis.get_loc(item) | |
self._mgr.iset(loc, value) |
But: 1) I am not fully sure in which case this _maybe_cache_changed
is used, and so value
can also be something else as a Series (so DataFrame)? and 2) iset
is being used in other places as well, where the same issue might occur
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.
re 2: I think iset is only called from 2 places in NDFrame. shouldnt be that hard to check unwrapping there, annotate iset
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.
Yeah, iset
itself is indeed only additionally used in _iset_item
, but that is then used in _set_item
and in indexing code, ... (and checking in the indexing code what values can be passed is already a bit less trivial ;-))
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.
OK. I might do a follow-up to try to push the check earlier
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.
extract_array to handle Index too?