Skip to content
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

STY: Enable pygrep ruff checks #53062

Merged
merged 6 commits into from
May 6, 2023
Merged

Conversation

mroeschke
Copy link
Member

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

@mroeschke mroeschke added the Code Style Code style, linting, code_checks label May 3, 2023

# TODO(wesm), incomplete test?
indexed_frame = DataFrame(data, index=index) # noqa
unindexed_frame = DataFrame(data) # noqa
Copy link
Member

Choose a reason for hiding this comment

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

did you make a decision to remove this or was it automated? id be OK with the former

Copy link
Member Author

Choose a reason for hiding this comment

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

I made the decision to remove this since it didn't seem clear that this would be fixed

@@ -30,7 +30,7 @@ from enum import Enum
class _NoDefault(Enum):
no_default = ...

no_default: Final = _NoDefault.no_default # noqa
no_default: Final = ...
Copy link
Member

Choose a reason for hiding this comment

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

I think this will break some type annotations

Copy link
Member

Choose a reason for hiding this comment

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

typeshed also does this python/typeshed#7127 not sure whether this is a "bug" in ruff

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 okay thanks I'll add back the noqa

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

generally looks good, nice, have just left a question (also, the typing comment)

def test_index_from_series_copy(using_copy_on_write):
def test_index_from_series_copy():
Copy link
Member

Choose a reason for hiding this comment

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

why remove using_copy_on_write?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, I removed this by accident. I reverted this

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

minor comments, rest looks good

@@ -265,7 +265,7 @@ def test_from_records_to_records(self):
arr[:] = [(1, 2.0, "Hello"), (2, 3.0, "World")]

# TODO(wesm): unused
Copy link
Member

Choose a reason for hiding this comment

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

can be removed now?

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. Removed

Comment on lines 603 to 600
result = empty_float.fillna(value=0) # noqa
float_frame.reindex(columns=[])
Copy link
Member

Choose a reason for hiding this comment

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

might want to keep the fillna?

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 good catch. Added back

@mroeschke mroeschke added this to the 2.1 milestone May 5, 2023
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

nice one @mroeschke

@MarcoGorelli MarcoGorelli merged commit 073156e into pandas-dev:main May 6, 2023
@mroeschke mroeschke deleted the sty/pygrep branch May 6, 2023 19:32
topper-123 pushed a commit to topper-123/pandas that referenced this pull request May 7, 2023
* STY: Enable pygrep ruff checks

* Address comments

* Uncomment code

* Address comments
Rylie-W pushed a commit to Rylie-W/pandas that referenced this pull request May 19, 2023
* STY: Enable pygrep ruff checks

* Address comments

* Uncomment code

* Address comments
Daquisu pushed a commit to Daquisu/pandas that referenced this pull request Jul 8, 2023
* STY: Enable pygrep ruff checks

* Address comments

* Uncomment code

* Address comments
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.

4 participants