Skip to content

Annoying Warning | process.extractOne | scorer=fuzz.token_sort_ratio |  #422

Description

@storesace-jorgelopes

Recently i changed from fuzzywuzzy library to rapidfuzz.
However on this code line i get the following warning:

from rapidfuzz import fuzz, process
best_match = process.extractOne(query=unidecode(col), choices=patterns, scorer=fuzz.token_sort_ratio, score_cutoff=80.0)

Unexpected type(s): (str, list[Union[str, Any]], Union[(s1: Sequence[Hashable], s2: Sequence[Hashable], Any, processor: None, score_cutoff: Optional[float]) -> float, (s1: _UnprocessedType1, s2: _UnprocessedType2, Any, processor: (Union[_UnprocessedType1, _UnprocessedType2]) -> Sequence[Hashable], score_cutoff: Optional[float]) -> float], float) Possible type(s): (Optional[Sequence[Hashable]], Mapping[_KeyType, Optional[_StringType2]], _Scorer[Sequence[Hashable], Sequence[Hashable], float, float], Optional[float]) (Optional[Sequence[Hashable]], Iterable[Optional[_StringType2]], _Scorer[Sequence[Hashable], Sequence[Hashable], float, float], Optional[float]) (Optional[str], Mapping[_KeyType, Optional[_StringType2]], _Scorer[str, _StringType2, _ResultType, _ResultType], Optional[float]) (Optional[str], Iterable[Optional[_StringType2]], _Scorer[str, _StringType2, _ResultType, _ResultType], Optional[float])

This warning only occurs because of scorer=fuzz.token_sort_ratio. If I remove it, no warning appears.
Can it be a variable typing bug on the function header?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions