Home / Function/ test_qdrant_from_texts_raises_error_on_different_vector_name() — langchain Function Reference

test_qdrant_from_texts_raises_error_on_different_vector_name() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/partners/qdrant/tests/integration_tests/qdrant_vector_store/test_from_texts.py lines 201–231

def test_qdrant_from_texts_raises_error_on_different_vector_name(
    location: str,
    first_vector_name: str,
    second_vector_name: str,
    retrieval_mode: RetrievalMode,
) -> None:
    """Test if Qdrant.from_texts raises an exception if vector name does not 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=first_vector_name,
        retrieval_mode=retrieval_mode,
        sparse_embedding=ConsistentFakeSparseEmbeddings(),
    )

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

        expected_message = "does not contain dense vector named"
        assert expected_message in str(excinfo.value)

Domain

Subdomains

Frequently Asked Questions

What does test_qdrant_from_texts_raises_error_on_different_vector_name() do?
test_qdrant_from_texts_raises_error_on_different_vector_name() 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_vector_name() defined?
test_qdrant_from_texts_raises_error_on_different_vector_name() is defined in libs/partners/qdrant/tests/integration_tests/qdrant_vector_store/test_from_texts.py at line 201.

Analyze Your Own Codebase

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

Try Supermodel Free