Skip to content

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

Closed
@CenTdemeern1

Description

@CenTdemeern1

Repository commit

51dba4d

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions