Fix error message formatting in _handle_proxies and grammatical error#1398
Open
JosephPTM1 wants to merge 1 commit into
Open
Fix error message formatting in _handle_proxies and grammatical error#1398JosephPTM1 wants to merge 1 commit into
JosephPTM1 wants to merge 1 commit into
Conversation
… in translate_to_boolean
Contributor
Author
|
Apologies for raising 2 PRs in what could have been 1. The first was a fix for something I had just personally experienced, this one was through just reading the rest of the code out of intrigue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Python doesn't allow
"%s",in exceptions, this will raise the exception as a tuple with"Invalid JSON passed for argument 'proxies': %s"as a literal string andproxiesas the other element in the tuple. I have changed it to an f string in this case rather than adapting it to"%s" % proxiesbecause TM1py is targeting Python 3.7 and f strings are faster and more readable. I tested this and it does indeed just raise that tuple.That being said, feel free to change this to "%s" % proxies if the consistency of it is important.
I also spotted a minor grammatical error while reading through the rest of the code with the line
Must be to be of type 'bool' or 'str'".