Skip to content

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

Merged
merged 32 commits into from
Jan 5, 2024
Merged

Conversation

mroeschke
Copy link
Member

No description provided.

@mroeschke mroeschke added the Code Style Code style, linting, code_checks label Dec 28, 2023
@mroeschke mroeschke added this to the 3.0 milestone Dec 28, 2023
# 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"]),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be "b"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Fixed

@@ -73,12 +73,10 @@ 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"]),
Copy link
Member

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"]?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Fixed

@@ -210,7 +210,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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, this is a dupe right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup but changing it to True fails a few tests so adding a noqa for now

Copy link
Member

Choose a reason for hiding this comment

The 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)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, #56727

Copy link
Member

@lithomas1 lithomas1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a couple more comments.

Thanks for cleaning these up by the way!

@@ -1555,7 +1555,6 @@ def test_constructor_mixed_type_rows(self):
"tuples,lists",
[
((), []),
((()), []),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, was this supposed to contain an inner tuple like
((),)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah possibly yes. That passes here so added it

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pretty cool - nice work!

@mroeschke mroeschke merged commit c25ed5d into pandas-dev:main Jan 5, 2024
@mroeschke mroeschke deleted the sty/ruff/pytest branch January 5, 2024 20:23
pmhatre1 pushed a commit to pmhatre1/pandas-pmhatre1 that referenced this pull request May 7, 2024
* Enable PT001

* Add PT002

* Add PT003

* ignore 4 and 5

* Ignore 6, 7, 8

* Ignore PT009

* Enable PT010

* Enable PT011

* Ignore 12, enable 13

* Enable PT014

* Enforce PT015

* Enable 16

* Disable 17

* Ignore 18

* Ignore 19

* Add 20

* add 21

* Enable 22

* Add 23

* Add 24

* Add 25

* add 26

* Add 27

* use PT

* fix some tests

* Deduplcate test

* Add tests

* Added nested tuple case
WillAyd added a commit to WillAyd/pandas that referenced this pull request Aug 22, 2024
WillAyd added a commit to WillAyd/pandas that referenced this pull request Aug 22, 2024
WillAyd added a commit to WillAyd/pandas that referenced this pull request Aug 22, 2024
WillAyd added a commit to WillAyd/pandas that referenced this pull request Aug 27, 2024
lithomas1 pushed a commit to lithomas1/pandas that referenced this pull request Sep 8, 2024
WillAyd added a commit to WillAyd/pandas that referenced this pull request Sep 20, 2024
jorisvandenbossche pushed a commit to WillAyd/pandas that referenced this pull request Oct 2, 2024
jorisvandenbossche pushed a commit to WillAyd/pandas that referenced this pull request Oct 2, 2024
jorisvandenbossche pushed a commit to WillAyd/pandas that referenced this pull request Oct 3, 2024
jorisvandenbossche pushed a commit to WillAyd/pandas that referenced this pull request Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants