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

Conversation

ChrisWallace2020
Copy link
Contributor

Calculating unique row ratio with 0 samples raises divide by 0 error, catch it in this case so no error is raised

@ChrisWallace2020 ChrisWallace2020 added Bug Something isn't working High Priority Dramatic improvement, inaccurate calculation(s) or bug / feature making the library unusable labels Aug 5, 2021
Copy link
Contributor

@JGSweets JGSweets left a comment

Choose a reason for hiding this comment

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

Add test

Comment on lines +1558 to +1560
if self.total_samples:
return len(self.hashed_row_dict) / self.total_samples
return 0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the only new logic, the changes below are simply refactors

@JGSweets JGSweets enabled auto-merge (squash) August 5, 2021 18:20
@JGSweets JGSweets merged commit 0bca7e4 into capitalone:main Aug 5, 2021
@JGSweets JGSweets mentioned this pull request Aug 9, 2021
stevensecreti pushed a commit to stevensecreti/DataProfiler that referenced this pull request Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working High Priority Dramatic improvement, inaccurate calculation(s) or bug / feature making the library unusable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants