langchain_qdrant: fix showing the missing sparse vector name (#30701)

**Description:** The error message was supposed to display the missing
vector name, but instead, it includes only the existing collection
configs.

This simple PR just includes the correct variable name, so that the user
knows the requested vector does not exist in the collection.

Additional guidelines:
- Make sure optional dependencies are imported within a function.
- Please do not add dependencies to pyproject.toml files (even optional
ones) unless they are required for unit tests.
- Most PRs should not touch more than one package.
- Changes should be backwards compatible.
- If you are adding something to community, do not re-import it in
langchain.

If no one reviews your PR within a few days, please @-mention one of
baskaryan, eyurtsev, ccurme, vbarda, hwchase17.

Signed-off-by: Tin Lai <tin@tinyiu.com>
This commit is contained in:
Tin Lai 2025-04-07 23:19:08 +10:00 committed by GitHub
parent 30af9b8166
commit 4d03ba4686
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1178,7 +1178,7 @@ class QdrantVectorStore(VectorStore):
):
raise QdrantVectorStoreError(
f"Existing Qdrant collection {collection_name} does not "
f"contain sparse vectors named {sparse_vector_config}. "
f"contain sparse vectors named {sparse_vector_name}. "
f"If you want to recreate the collection, set `force_recreate` "
f"parameter to `True`."
)