Skip to content

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

Merged
merged 8 commits into from
Jan 6, 2020

Conversation

AlfredoGJ
Copy link
Contributor

@pep8speaks
Copy link

pep8speaks commented Jan 5, 2020

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

@AlfredoGJ AlfredoGJ changed the title replacing '.format' with f-strings in various files CLN: replacing '.format' with f-strings in various files Jan 5, 2020
title_line = "{side} {title}{adj} {side}".format(
side=char * side_len, title=title, adj=adj
)
title_line = f"{char * side_len} {title}{adj} {side}"
Copy link
Member

@ShaharNaveh ShaharNaveh Jan 5, 2020

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} 😄

Copy link
Contributor Author

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.

@simonjayhawkins simonjayhawkins added the Code Style Code style, linting, code_checks label Jan 5, 2020
Copy link
Member

@simonjayhawkins simonjayhawkins left a 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.

"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"
Copy link
Member

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

Suggested change
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"
Copy link
Member

Choose a reason for hiding this comment

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

same

Copy link
Contributor Author

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;"
Copy link
Member

Choose a reason for hiding this comment

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

same

Copy link
Member

@datapythonista datapythonista left a 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.

@@ -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"
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback

Copy link
Member

@simonjayhawkins simonjayhawkins left a 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.

@jreback jreback added this to the 1.0 milestone Jan 6, 2020
@jreback jreback merged commit 036dc88 into pandas-dev:master Jan 6, 2020
@jreback
Copy link
Contributor

jreback commented Jan 6, 2020

thanks @AlfredoGJ

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.

6 participants