Skip to content

Commit 0d352c4

Browse files
authored
vectors: remove use of float as row number (explosion#10955)
The float -1 was returned rather than the integer -1 as the row for unknown keys. This doesn't introduce a realy bug, since such floats cast (without issues) to int in the conversion to NumPy arrays. Still, it's nice to to do the correct thing :).
1 parent 126d1db commit 0d352c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spacy/vectors.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ cdef class Vectors:
339339
return self.key2row.get(key, -1)
340340
elif keys is not None:
341341
keys = [get_string_id(key) for key in keys]
342-
rows = [self.key2row.get(key, -1.) for key in keys]
342+
rows = [self.key2row.get(key, -1) for key in keys]
343343
return xp.asarray(rows, dtype="i")
344344
else:
345345
row2key = {row: key for key, row in self.key2row.items()}

0 commit comments

Comments
 (0)