-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
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
HnswDocumentIndex treats document IDs as string, they can be str, int, ID #1850
Comments
hey @oytuntez , thanks for the issue reported, would it be possible for you to share a code snippet showing the issue with DocArray code, avoiding as much as possible other dependencies? Thanks |
Hi @JoanFM, Here is my proposed solution: |
can you please provide an isolated code to reproduce the issue? |
Hey I have tried to simulate the scenario where an integer ID is passed to a method that expects a string ID and tries to hash it, here it is:
That would be great if @oytuntez can give us the actual reproducable code!! |
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
HnswDocumentIndex
treats IDs asstr
. However, it is my understanding that IDs can beint
, see this type definition:I think ID values should be cast to
str
if necessary (it would be in_to_hashed_id
case).Example Code
No response
Python, DocArray & OS Version
Affected Components
The text was updated successfully, but these errors were encountered: