-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: replacing '.format' with f-strings in various files #30706
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
Hello @AlfredoGJ! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2020-01-06 16:14:06 UTC |
scripts/validate_docstrings.py
Outdated
title_line = "{side} {title}{adj} {side}".format( | ||
side=char * side_len, title=title, adj=adj | ||
) | ||
title_line = f"{char * side_len} {title}{adj} {side}" |
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.
Replace the {side}
(at the very end) with {char * side_len}
😄
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.
Now I see, thank you.
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.
@AlfredoGJ Thanks for the PR. some minor nits otherwise lgtm.
pandas/tseries/holiday.py
Outdated
"Holiday Calendar {name} does not have any " | ||
"rules specified".format(name=self.name) | ||
f"Holiday Calendar {self.name} does not have any " | ||
f"rules specified" |
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.
f string prefix not needed here
f"rules specified" | |
"rules specified" |
"`requirements-dev.txt` has to be generated with `{}` after " | ||
"`environment.yml` is modified.\n".format(sys.argv[0]) | ||
f"`requirements-dev.txt` has to be generated with `{sys.argv[0]}` after " | ||
f"`environment.yml` is modified.\n" |
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.
same
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.
Thanks for your feedback, I just changed it
) | ||
if args.azure: | ||
msg = ( | ||
"##vso[task.logissue type=error;" | ||
"sourcepath=requirements-dev.txt]{}".format(msg) | ||
f"##vso[task.logissue type=error;" |
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.
same
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.
Thanks @AlfredoGJ, just one small thing, and this can be merged.
pandas/tseries/holiday.py
Outdated
@@ -394,8 +394,7 @@ def holidays(self, start=None, end=None, return_name=False): | |||
""" | |||
if self.rules is None: | |||
raise Exception( | |||
"Holiday Calendar {name} does not have any " | |||
"rules specified".format(name=self.name) | |||
f"Holiday Calendar {self.name} does not have any " "rules specified" |
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.
You'll have to join these two strings
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.
Thanks for the feedback
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.
@AlfredoGJ lgtm pending green.
thanks @AlfredoGJ |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff