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

QdrantDocumentStore type errors when adding to DocumentWriter #1039

Closed
jscheel opened this issue Aug 29, 2024 · 3 comments · Fixed by #1041
Closed

QdrantDocumentStore type errors when adding to DocumentWriter #1039

jscheel opened this issue Aug 29, 2024 · 3 comments · Fixed by #1041
Labels
bug Something isn't working integration:qdrant P2

Comments

@jscheel
Copy link
Contributor

jscheel commented Aug 29, 2024

Describe the bug

"QdrantDocumentStore" is incompatible with protocol "DocumentStore"
    "write_documents" is an incompatible type
      Type "(documents: List[Document], policy: DuplicatePolicy = DuplicatePolicy.FAIL) -> (int | None)" cannot be assigned to type "(documents: List[Document], policy: DuplicatePolicy = DuplicatePolicy.NONE) -> int"
        Function return type "int | None" is incompatible with type "int"
          Type "int | None" cannot be assigned to type "int"
    "delete_documents" is an incompatible type
      Type "(ids: List[str]) -> None" cannot be assigned to type "(document_ids: List[str]) -> None"
        Parameter name mismatch: "document_ids" versus "ids"

To Reproduce
Run type-checking on this code:

from haystack_integrations.document_stores.qdrant import QdrantDocumentStore
from haystack.components.writers import DocumentWriter

store = QdrantDocumentStore()
writer = DocumentWriter(store)

Describe your environment (please complete the following information):

  • OS: macOS 14.5
  • Haystack version: 2.4.0
  • Integration version: 4.2.0
@jscheel jscheel added the bug Something isn't working label Aug 29, 2024
@anakin87
Copy link
Member

I agree, these are bugs. Thanks for reporting them.
Luckily, they do not seem hard to fix.

Would you like to open a PR?
Let us know... Otherwise, we will fix them soon.

@jscheel
Copy link
Contributor Author

jscheel commented Aug 30, 2024 via email

@jscheel
Copy link
Contributor Author

jscheel commented Aug 30, 2024

Submitted a quick PR. Please note that it technically has a breaking change because of an argument name change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working integration:qdrant P2
Projects
3 participants