Python icon indicating copy to clipboard operation
Python copied to clipboard

`maths\jaccard_similarity.py` does not validate input and can divide by zero

Open CenTdemeern1 opened this issue 2 years ago • 5 comments

Repository commit

51dba4d743cd2c8d407eea3e9cd4e7b2f69ee34d

Python version (python --version)

Python 3.10.2

Dependencies version (pip freeze)

pip==22.2.2 setuptools==60.10.0 wheel==0.37.1

Expected behavior

According to CONTRIBUTING.md, a ValueError should be raised in the case of erroneous input. image

Actual behavior

This code makes no effort to check the input, and this can result in a zero division when given empty lists as input: image

CenTdemeern1 avatar Oct 10 '22 13:10 CenTdemeern1

what do you want to return from the function when the length of union set is 0 ? assign me i will add a validating condition

CoderRounak avatar Oct 10 '22 15:10 CoderRounak

Please don't beg me to assign you. I am handling this myself. Hell, you probably didn't even read my issue message, nor did you read CONTRIBUTING.md.

CenTdemeern1 avatar Oct 10 '22 15:10 CenTdemeern1

That commit does not solve the issue!

CenTdemeern1 avatar Oct 10 '22 15:10 CenTdemeern1

Hello, Can you assign this issue to me?

nfarhaan avatar Oct 11 '22 21:10 nfarhaan

No, go away, spambot.

CenTdemeern1 avatar Oct 12 '22 12:10 CenTdemeern1