Home / Function/ test_qdrant_from_texts_raises_error_on_different_dimensionality() — langchain Function Reference

test_qdrant_from_texts_raises_error_on_different_dimensionality() — langchain Function Reference

Architecture documentation for the test_qdrant_from_texts_raises_error_on_different_dimensionality() function in test_from_texts.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  f244a0d7_ff6f_6743_6371_95c7808d094a["test_qdrant_from_texts_raises_error_on_different_dimensionality()"]
  911ffb0f_3570_ae90_9ff9_2c9c03151aea["test_from_texts.py"]
  f244a0d7_ff6f_6743_6371_95c7808d094a -->|defined in| 911ffb0f_3570_ae90_9ff9_2c9c03151aea
  style f244a0d7_ff6f_6743_6371_95c7808d094a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/qdrant/tests/integration_tests/qdrant_vector_store/test_from_texts.py lines 158–188

def test_qdrant_from_texts_raises_error_on_different_dimensionality(
    location: str,
    vector_name: str,
    retrieval_mode: RetrievalMode,
) -> None:
    """Test if Qdrant.from_texts raises an exception if dimensionality doesn't match."""
    collection_name = uuid.uuid4().hex
    QdrantVectorStore.from_texts(
        ["lorem", "ipsum", "dolor", "sit", "amet"],
        ConsistentFakeEmbeddings(dimensionality=10),
        collection_name=collection_name,
        location=location,
        vector_name=vector_name,
        retrieval_mode=retrieval_mode,
        sparse_embedding=ConsistentFakeSparseEmbeddings(),
    )

    with pytest.raises(QdrantVectorStoreError) as excinfo:
        QdrantVectorStore.from_texts(
            ["foo", "bar"],
            ConsistentFakeEmbeddings(dimensionality=5),
            collection_name=collection_name,
            location=location,
            vector_name=vector_name,
            retrieval_mode=retrieval_mode,
            sparse_embedding=ConsistentFakeSparseEmbeddings(),
        )

        expected_message = "collection is configured for dense vectors "
        "with 10 dimensions. Selected embeddings are 5-dimensional"
        assert expected_message in str(excinfo.value)

Domain

Subdomains

Frequently Asked Questions

What does test_qdrant_from_texts_raises_error_on_different_dimensionality() do?
test_qdrant_from_texts_raises_error_on_different_dimensionality() is a function in the langchain codebase, defined in libs/partners/qdrant/tests/integration_tests/qdrant_vector_store/test_from_texts.py.
Where is test_qdrant_from_texts_raises_error_on_different_dimensionality() defined?
test_qdrant_from_texts_raises_error_on_different_dimensionality() is defined in libs/partners/qdrant/tests/integration_tests/qdrant_vector_store/test_from_texts.py at line 158.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free