We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
nan
Problem:
nan value is not None, so it will be skipped by check_for_none. And nan is float and don't have len method, so check_empty_string raises an error.
check_for_none
len
check_empty_string
>>> from thefuzz.fuzz import ratio >>> ratio("a", float("nan")) # or `np.nan` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\Zero\mambaforge\envs\dtoolkit-dev\lib\site-packages\thefuzz\utils.py", line 38, in decorator return func(*args, **kwargs) File "C:\Users\Zero\mambaforge\envs\dtoolkit-dev\lib\site-packages\thefuzz\utils.py", line 29, in decorator return func(*args, **kwargs) File "C:\Users\Zero\mambaforge\envs\dtoolkit-dev\lib\site-packages\thefuzz\utils.py", line 46, in decorator if len(args[0]) == 0 or len(args[1]) == 0: TypeError: object of type 'float' has no len()
Solution:
check_for_none need to be updated. or create a new decorator for handling nan value.
thefuzz/thefuzz/utils.py
Lines 33 to 39 in 6e68af8
The text was updated successfully, but these errors were encountered:
Now that rapidfuzz is used under the hood, this is working
Sorry, something went wrong.
No branches or pull requests
Problem:
nan
value is not None, so it will be skipped bycheck_for_none
.And
nan
is float and don't havelen
method, socheck_empty_string
raises an error.Solution:
check_for_none
need to be updated.or create a new decorator for handling
nan
value.thefuzz/thefuzz/utils.py
Lines 33 to 39 in 6e68af8
The text was updated successfully, but these errors were encountered: