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.
WARN: Remove false positive warning for iloc inplaceness #48397
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
WARN: Remove false positive warning for iloc inplaceness #48397
Changes from 11 commits
8f7432b
9ac855b
2c3920c
8fc58f3
ab1080c
1aa0448
40427c4
7240895
a1a824c
03bc147
44e910d
0d2c2c4
7f04bdc
c4b0780
49da3ce
7e4e5e8
805ec5d
7762cda
ead315a
8a772c7
b4714ce
a6de70e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
how do we get here with warn=True?
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.
iloc._setitem_with_indexer(indexer, value, self.name)
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, so i think what's happening here is that we are checking can_hold_element too soon, bc reindexing occurs within
self.obj._iset_item(loc, value)
. I think it would be better to do the reindex before the can_hold_element checkThere 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.
Pushed a suggestion. Not sure what is better performance wise. Checking initially and the rechecking? Is
_get_column_array
expensive or cheap? If it is cheap, it might be better only checking can_hold_element for new values?This breaks one test, not sure if you can set an all NaT Series into an underlying Series with timezone
UTC
?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.
_get_column_array is pretty cheap. its the isna(...).any() that i think may be expensive
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.
depends on the dtype of the all-NaT Series
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.
original values are
datetime64[ns, UTC]
and all NaT Series isdatetime64[ns]
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.
that should definitely not be inplace
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.
Great, we fixed the test instead of breaking it :)
Anything against checking only new_values then? See latest commit now.
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.
i think that makes sense. caffeine is still kicking in though