-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
STY: Enable ruff pytest checks #56671
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
e672f7b
6ce08db
fc2e0d2
d225564
8fe6476
d99f392
8d27e34
d7379bd
0cdc13a
78692da
893cf5b
5702122
47ce700
a2ebb71
3ea2e08
022135b
ecf0592
dd879a6
cfaa72a
01adb5a
477d2d2
7458b8b
d520b13
31c2ce3
54f6bce
0511ebe
01472dc
2dc60a9
f3be5ab
9c6d650
44e4729
547ece5
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 |
---|---|---|
|
@@ -73,12 +73,12 @@ def test_set_dtype_new_categories(self): | |
(["a", "b", "c"], ["a", "b"], ["a", "b"]), | ||
(["a", "b", "c"], ["a", "b"], ["b", "a"]), | ||
(["b", "a", "c"], ["a", "b"], ["a", "b"]), | ||
(["b", "a", "c"], ["a", "b"], ["a", "b"]), | ||
(["b", "a", "c"], ["a", "b"], ["b", "a"]), | ||
# Introduce NaNs | ||
(["a", "b", "c"], ["a", "b"], ["a"]), | ||
(["a", "b", "c"], ["a", "b"], ["b"]), | ||
(["b", "a", "c"], ["a", "b"], ["a"]), | ||
(["b", "a", "c"], ["a", "b"], ["a"]), | ||
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. Should this be "b"? 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. Good catch. Fixed |
||
(["b", "a", "c"], ["a", "b"], ["b"]), | ||
# No overlap | ||
(["a", "b", "c"], ["a", "b"], ["d", "e"]), | ||
], | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -209,7 +209,8 @@ def test_setitem_integer_array(self, data, idx, box_in_series): | |
[0, 1, 2, pd.NA], True, marks=pytest.mark.xfail(reason="GH-31948") | ||
), | ||
(pd.array([0, 1, 2, pd.NA], dtype="Int64"), False), | ||
(pd.array([0, 1, 2, pd.NA], dtype="Int64"), False), | ||
# TODO: change False to True? | ||
(pd.array([0, 1, 2, pd.NA], dtype="Int64"), False), # noqa: PT014 | ||
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. Hm, this is a dupe right? 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. Yup but changing it to 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. Can you open an issue as a followup? (the noqa makes it look like ruff had a false positive) 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. Sure, #56727 |
||
], | ||
ids=["list-False", "list-True", "integer-array-False", "integer-array-True"], | ||
) | ||
|
@@ -332,7 +333,7 @@ def test_setitem_loc_iloc_slice(self, data): | |
|
||
def test_setitem_slice_mismatch_length_raises(self, data): | ||
arr = data[:5] | ||
with pytest.raises(ValueError): | ||
with tm.external_error_raised(ValueError): | ||
lithomas1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
arr[:1] = arr[:2] | ||
|
||
def test_setitem_slice_array(self, data): | ||
|
@@ -342,7 +343,7 @@ def test_setitem_slice_array(self, data): | |
|
||
def test_setitem_scalar_key_sequence_raise(self, data): | ||
arr = data[:5].copy() | ||
with pytest.raises(ValueError): | ||
with tm.external_error_raised(ValueError): | ||
arr[0] = arr[[0, 1]] | ||
|
||
def test_setitem_preserves_views(self, data): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1555,7 +1555,7 @@ def test_constructor_mixed_type_rows(self): | |
"tuples,lists", | ||
[ | ||
((), []), | ||
((()), []), | ||
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. Hm, was this supposed to contain an inner tuple like 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. Ah possibly yes. That passes here so added it |
||
(((),), [[]]), | ||
(((), ()), [(), ()]), | ||
(((), ()), [[], []]), | ||
(([], []), [[], []]), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -304,7 +304,6 @@ def test_from_arrays_empty(): | |
(1, 2), | ||
([1], 2), | ||
(1, [2]), | ||
"a", | ||
("a",), | ||
("a", "b"), | ||
(["a"], "b"), | ||
|
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.
Should this end with ["b", "a"]?
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.
Good catch. Fixed