-
Notifications
You must be signed in to change notification settings - Fork 16
Make validation class pass the linter #578
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
@nmdefries can you unapprove this? I'm going to add some lint compliance fixes and haven't pushed them through. |
Reviewed too early; more changes to come
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.
Everything else looks good. Thanks for the improved organization and structure!
|
||
if geo_sig_api_df is None: | ||
if isinstance(api_df_or_error, APIDataFetchError): | ||
self.increment_total_checks() |
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.
increment_total_checks()
should be outside of the if
statement of the check since we want to count it whether the check passes (if
block isn't run) or fails (if
block is run).
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 call, fixed.
validator/delphi_validator/errors.py
Outdated
@@ -31,6 +31,7 @@ def __init__(self, check_data_id, expression, message): | |||
pass a check, provide the date | |||
- message: str explaining why an error was raised | |||
""" | |||
super().__init__(message) |
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.
The super init changes the output of Validator.exit()
so that only the error message is printed. This isn't a concern here since you have the incoming validator report PR; just wanted you to be aware that the goal is to include the check_data_id
(unique error-data combo identifier), expression, and message in error output.
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 thought I had fixed this by moving the call to super().__init__()
to the top of the function, but you are correct that it squashes the full error message. I have changed this to take all the arguments which produces the same output as before.
Description
Refactor validation module to be lint compliant and otherwise more readable. This PR fails to address one lint issue with the number of member variables of
Validator
; I will address it in a follow-on PR (see #579).Changelog
validate()
into a short, high-level functionvalidate.py