Skip to content

STYLE: replace unwanted-patterns-strings-to-concatenate with ruff #51613

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

Conversation

natmokval
Copy link
Contributor

Unwanted-patterns-strings-to-concatenate replaced with ruff.

@@ -318,7 +318,8 @@ def setup(self, sep, decimal, float_precision):
"".join([random.choice(string.digits) for _ in range(28)])
for _ in range(15)
]
rows = sep.join([f"0{decimal}" + "{}"] * 3) + "\n"
row = "".join([f"0{decimal}", "{}"])
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for working on this!

Would it work to do

rows = sep.join([f"0{decimal}{{}}"] * 3) + "\n"

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you, it works nicely. I corrected my PR.

@mroeschke mroeschke added the Code Style Code style, linting, code_checks label Feb 24, 2023
Copy link
Member

@twoertwein twoertwein left a comment

Choose a reason for hiding this comment

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

There are some "".join(...) calls which could be simplified but I also wouldn't mind keeping them as-is (that way it might be clearer that they represent different rows in the Series/DataFrame).

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.

Looks good to me on green, do you want to mark as ready for review?

@natmokval natmokval marked this pull request as ready for review February 27, 2023 11:36
@MarcoGorelli MarcoGorelli added this to the 2.1 milestone Feb 27, 2023
@natmokval
Copy link
Contributor Author

I resolved the merge conflict and updated my branch.

@twoertwein twoertwein merged commit 29140d4 into pandas-dev:main Feb 27, 2023
@twoertwein
Copy link
Member

Thank you @natmokval!

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.

STYLE: replace unwanted-patterns-strings-to-concatenate with ruff
4 participants