Skip to content

Updated ruff pre-commit version and modified few lines according to it. #54639

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 5 commits into from
Aug 21, 2023
Merged

Updated ruff pre-commit version and modified few lines according to it. #54639

merged 5 commits into from
Aug 21, 2023

Conversation

Sai-Suraj-27
Copy link
Contributor

Ruff 0.0.285 has been released (https://github.com/astral-sh/ruff-pre-commit).

So, I have updated the ruff version in .pre-commit-config.yaml file, ran ruff . and corrected few files according to the errors it showed.

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

@Sai-Suraj-27
Copy link
Contributor Author

@mroeschke sir, can you please review the PR, Thank you.

@@ -903,7 +903,7 @@ def _list_of_dict_to_arrays(

# assure that they are of the base dict class and not of derived
# classes
data = [d if type(d) is dict else dict(d) for d in data]
data = [d if type(d) is dict else dict(d) for d in data] # noqa: E721
Copy link
Member

@twoertwein twoertwein Aug 19, 2023

Choose a reason for hiding this comment

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

Instead of ignoring the issue, maybe try [d if isinstance(d, dict) ...]?

edit: The comment suggests that it needs to be a dict and not a subclass

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@twoertwein yes, sir. So, I guess there is nothing I need to change?

@mroeschke mroeschke added the Code Style Code style, linting, code_checks label Aug 21, 2023
@mroeschke mroeschke added this to the 2.2 milestone Aug 21, 2023
@mroeschke mroeschke merged commit ade0483 into pandas-dev:main Aug 21, 2023
@mroeschke
Copy link
Member

Thanks @Sai-Suraj-27

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