-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
fix: several disabled pylint rules in models/helpers.py #10909
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
aa608e9
Removed conflicting lint and isort check in model helpers seems it's …
kkucharc 858a275
Removed disabled linting for accessing private method. `parent_foreig…
kkucharc aea3303
Updated model's helper - removed unecessary exception and replaced wi…
kkucharc 4632bb3
Updated model's helper - renamed unused attribute to private in user …
kkucharc 422c026
Updated model's helper - added specific exception for adding extra js…
kkucharc e22195b
Applied changes after review to `models/helpers.py`:
kkucharc 17e3a54
Removed self.extra_json content from exception message.
kkucharc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
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.
Can
exc
orexc_info
log data fromself.extra_json
?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.
Good idea! I will add it to an exception logger.
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.
maybe I did not explain myself right, sorry. I want to make sure that
self.extra_json
never gets logged byTypeError
orJSONDecodeError
byexc
orexc_info
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.
@dpgaspar do you mind to take a look again? I have one doubt: do you think is it possible there could be raised exception while accessing
self.extra_json
for logger?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.
Och, I see, then I just did the opposite thing! :) Reverting this change.
To be honest I think
JSONDecodeError
will show error message%s: line %d column %d (char %d)
.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.
Just to be sure I check that and any of them won't show what
self.extra_json
contains.JSONDecodeError
should something like:json.decoder.JSONDecodeError: Unterminated string starting at: line 1 column 11 (char 10)
with stacktrace.
And
TypeError
something like this for example:TypeError: the JSON object must be str, bytes or bytearray, not dict
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.
nice then, thks