Skip to content
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

[BUG] Add documents validation failure when use_existing_tensors=True #650

Open
farshidz opened this issue Nov 28, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@farshidz
Copy link
Collaborator

Describe the bug
When adding documents with use_existing_tensors=True and an invalid document that is not a dictionary, we get a 500 error instead of the expected 400 that we get use_existing_tensors=False.

To Reproduce

mq_os.create_index('my-index-1')

mq_os.index('my-index-1').add_documents(
    [
        1234
    ],
    tensor_fields=['title', 'age'],
    use_existing_tensors=True
)

Expected behavior
400

Screenshots
N/A

Desktop (please complete the following information):
Tested with macOS, but N/A

Additional context
This issue happens because validation takes place after use_existing_tensors logic assumes the document is a dictionary. See

validation.validate_doc(doc)

@farshidz farshidz added the bug Something isn't working label Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant