-
Notifications
You must be signed in to change notification settings - Fork 3k
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
{Pylint} Fix redundant-u-string-prefix #30325
Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
Thank you for your contribution atombrella! We will review the pull request and get back to you soon. |
# to serialize correctly u'' strings | ||
return data | ||
except NameError: | ||
return str(data) | ||
return str(data) |
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.
Isn't data
already a str
per L925? @evelyn-ys
return str(data) | |
return data |
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.
I actually fully copied all the files from SDK, not sure why here's a str()
, but I prefer not modifying files under vendored_sdks
. BTW, this azure-keyvault-securitydomain
vendored sdk will be removed after SDK team publish to pypi
@@ -325,8 +325,7 @@ def test_deployment_prompt_file_order(self): | |||
result_parameters = _process_parameters(template, parameter_list) | |||
missing_parameters = _find_missing_parameters(result_parameters, template) | |||
|
|||
param_file_order = ["[u'secureParam', u'boolParam', u'enumParam', u'arrayParam', u'objectParam']", | |||
"['secureParam', 'boolParam', 'enumParam', 'arrayParam', 'objectParam']"] | |||
param_file_order = ["['secureParam', 'boolParam', 'enumParam', 'arrayParam', 'objectParam']"] |
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.
There is no need to put "['secureParam', 'boolParam', 'enumParam', 'arrayParam', 'objectParam']"
in a list anymore.
L330 should also use
self.assertTrue(str(list(results.keys())) == param_file_order)
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.
I left some comments, but they require code logic change, which is out of the scope of this PR.
29f81eb
to
2038011
Compare
@evelyn-ys @necusjz @jiasli Could you please have another look at this? There are issues with the test runs. I think it's ready to be merged. |
@atombrella, Thank you very much for the contribution! |
Description
Another bit of legacy from the past Python 2 days. #20192 deactivated the particular u-prefix linter.
There are several instances of Python 2 import-guards. I fixed a couple of them in affected files. Maybe those are unaffected. As far as I can see, Python 3.5 is a minimum requirement.
History Notes
This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.