-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG raise pdep6 warning for loc full setter #56146
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 all commits
4644c00
da7efad
9e400c2
003b993
3ff469f
e561aa5
cd9408e
58ce78e
6564773
4c345e4
ea51b08
388ded7
14c9ff6
846b529
4f5495c
9c26bb3
3f82a91
874b596
162586c
467742c
5d24fb0
a43b737
24afe06
20c89a2
7a25a86
3240bb9
755ded6
28a731b
27bf409
b1a4777
5b43509
191ce85
428c146
12cd484
cd208ca
3dd4d36
45dd43b
54f3459
96ee0ae
0bc2205
e3b04b7
c81c486
9d604da
c1fa7f3
7b0e3c8
183a609
ee0f35d
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 |
---|---|---|
|
@@ -499,6 +499,9 @@ def coerce_to_target_dtype(self, other, warn_on_upcast: bool = False) -> Block: | |
and is_integer_dtype(self.values.dtype) | ||
and isna(other) | ||
and other is not NaT | ||
and not ( | ||
isinstance(other, (np.datetime64, np.timedelta64)) and np.isnat(other) | ||
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. i think the isnat here is unnecessary since we already have isna(other) above 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. the idea of the this This is the case if |
||
) | ||
): | ||
warn_on_upcast = False | ||
elif ( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -491,7 +491,7 @@ def _check_setitem_invalid(self, ser, invalid, indexer, warn): | |
np.datetime64("NaT"), | ||
np.timedelta64("NaT"), | ||
] | ||
_indexers = [0, [0], slice(0, 1), [True, False, False]] | ||
_indexers = [0, [0], slice(0, 1), [True, False, False], slice(None, None, 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. this looks similar to the DataFrame test above. lets try to de-duplicate it one of these days |
||
|
||
@pytest.mark.parametrize( | ||
"invalid", _invalid_scalars + [1, 1.0, np.int64(1), np.float64(1)] | ||
|
@@ -505,7 +505,7 @@ def test_setitem_validation_scalar_bool(self, invalid, indexer): | |
@pytest.mark.parametrize("indexer", _indexers) | ||
def test_setitem_validation_scalar_int(self, invalid, any_int_numpy_dtype, indexer): | ||
ser = Series([1, 2, 3], dtype=any_int_numpy_dtype) | ||
if isna(invalid) and invalid is not NaT: | ||
if isna(invalid) and invalid is not NaT and not np.isnat(invalid): | ||
warn = None | ||
else: | ||
warn = FutureWarning | ||
|
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.
big fan of this very clear comment!