Skip to content

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

Merged
merged 16 commits into from
Dec 3, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 0 additions & 33 deletions validator/delphi_validator/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,38 +187,6 @@ def check_missing_date_files(self, daily_filenames):

self.increment_total_checks()

def check_settings(self):
"""
Perform some automated format & sanity checks of parameters.

Arguments:
- None

Returns:
- None
"""
if not isinstance(self.max_check_lookbehind, timedelta):
self.raised_errors.append(ValidationError(
("check_type_max_check_lookbehind"),
self.max_check_lookbehind,
"max_check_lookbehind must be of type datetime.timedelta"))

self.increment_total_checks()

if not isinstance(self.generation_date, date):
self.raised_errors.append(ValidationError(
("check_type_generation_date"), self.generation_date,
"generation_date must be a datetime.date type"))

self.increment_total_checks()

if self.generation_date > date.today():
self.raised_errors.append(ValidationError(
("check_future_generation_date"), self.generation_date,
"generation_date must not be in the future"))

self.increment_total_checks()

def check_df_format(self, df_to_test, nameformat):
"""
Check basic format of source data CSV df.
Expand Down Expand Up @@ -739,7 +707,6 @@ def validate(self, export_dir):
validate_files = [(f, m) for (f, m) in export_files if date_filter(m)]

self.check_missing_date_files(validate_files)
self.check_settings()

all_frames = []

Expand Down