Skip to content

Commit

Permalink
- notmalize integer output, since cur may contain both int and np.int…
Browse files Browse the repository at this point in the history
…32 dtypes. If int32 is returned FastAPI can't serialize this type.
  • Loading branch information
KKGBiz committed Apr 24, 2024
1 parent 65c5e84 commit 51711e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion textdistance/algorithms/edit_based.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def _cycled(self, s1: Sequence[T], s2: Sequence[T]) -> int:
dist = self.test_func(s1[r - 1], s2[c - 1])
edit = prev[c - 1] + (not dist)
cur[c] = min(edit, deletion, insertion)
return cur[-1]
return int(cur[-1])

def __call__(self, s1: Sequence[T], s2: Sequence[T]) -> int:
s1, s2 = self._get_sequences(s1, s2)
Expand Down

0 comments on commit 51711e0

Please sign in to comment.