You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 9, 2026. It is now read-only.
And when I issue POST /find with body {"data":[{"id":"300055"}]}, this code yields:
"/Users/oytuntez/motaword/jina-documents/venv/lib/py… line 544, in _get_docs_sqlite_doc_id hashed_ids = tuple(self._to_hashed_id(id_) for id_ in doc_ids) File "/Users/oytuntez/motaword/jina-documents/venv/lib/py…
line 544, in<genexpr>
hashed_ids = tuple(self._to_hashed_id(id_) for
id_ in doc_ids)
File
"/Users/oytuntez/motaword/jina-documents/venv/lib/py… line 445, in _to_hashed_id return int(hashlib.sha256(doc_id.encode('utf-8')).hexdigest… 16) % 10**18 AttributeError: 'int' object has no attribute 'encode'
Upon investigation, I saw that most of HnswDocumentIndex treats IDs as str. However, it is my understanding that IDs can be int, see this type definition:
classID(str, AbstractType):
""" Represent an unique ID """@classmethoddef_docarray_validate(
cls: Type[T],
value: Union[str, int, UUID],
...
I think ID values should be cast to str if necessary (it would be in _to_hashed_id case).
Initial Checks
Description
I noticed this behavior when I wanted to access multiple documents in the index:
And when I issue POST /find with body
{"data":[{"id":"300055"}]}, this code yields:Upon investigation, I saw that most of
HnswDocumentIndextreats IDs asstr. However, it is my understanding that IDs can beint, see this type definition:I think ID values should be cast to
strif necessary (it would be in_to_hashed_idcase).Example Code
No response
Python, DocArray & OS Version
Affected Components