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

Catch Divide by 0 bug for unique row ratio #384

Merged
merged 3 commits into from
Aug 5, 2021
Merged
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion dataprofiler/profilers/profile_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,8 @@ def report(self, report_options=None):
return _prepare_report(report, output_format, omit_keys)

def _get_unique_row_ratio(self):
return len(self.hashed_row_dict) / self.total_samples
return 0 if self.total_samples in {0, None} \
else len(self.hashed_row_dict) / self.total_samples

def _get_row_is_null_ratio(self):
return 0 if self._min_col_samples_used in {0, None} \
Expand Down