Skip to content
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

Avoid dynamic validation when no files are exported #1773

Merged
merged 6 commits into from
Feb 3, 2023

Conversation

M5Skid
Copy link
Contributor

@M5Skid M5Skid commented Jan 31, 2023

Description

Fixes exceptions caused by dynamic validation, where dataframe commands were failing on empty dataframes. If no export files are found after the indicator run, dynamic validation will be skipped as the static validation will perform the check for an empty file list.

  • In the case of an empty file list, the "check_empty_filelist" check should be the only validation step performed, and can be suppressed in params.

Changelog

validate.py

  • dynamic validation included in the if statement checking the length of the frames_list. If frames list is empty, dynamic validation will not occur.

Fixes

@M5Skid M5Skid requested review from neul3 and krivard January 31, 2023 22:14
@M5Skid M5Skid marked this pull request as ready for review January 31, 2023 22:25
@@ -63,5 +63,5 @@ def validate(self):
all_frames = []
else:
all_frames = aggregate_frames(frames_list)
self.dynamic_validation.validate(all_frames, report)
self.dynamic_validation.validate(all_frames, report)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: all_frames isn't needed when frames_list is empty

could we replace the entire if block with something like this instead?

if len(frames_list) > 0:
    self.dynamic_validation.validate(aggregate_frames(frames_list), report)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense and would look much cleaner. I'll put that in and do some testing.

Copy link
Contributor

@krivard krivard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 good fix!

@krivard krivard merged commit f172949 into cmu-delphi:main Feb 3, 2023
@M5Skid M5Skid deleted the issue1746_validator-no-output branch March 14, 2023 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validator throws an exception when no output is produced by the indicator
2 participants