From 8e13afa6cb124684fd2edb78a629b3afb914e318 Mon Sep 17 00:00:00 2001 From: Xin Heng Date: Wed, 4 Dec 2024 14:02:38 -0800 Subject: [PATCH] Updated documents --- .../tests/integration_tests/vectorstores/test_weaviate.py | 5 ++--- .../integration_tests/retrievers/self_query/test_base.py | 1 - .../tests/integration_tests/vectorstores/test_weaviate.py | 5 ++--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/libs/community/tests/integration_tests/vectorstores/test_weaviate.py b/libs/community/tests/integration_tests/vectorstores/test_weaviate.py index a6ade6d3b6f02..936d8d4f3e8b8 100644 --- a/libs/community/tests/integration_tests/vectorstores/test_weaviate.py +++ b/libs/community/tests/integration_tests/vectorstores/test_weaviate.py @@ -11,13 +11,12 @@ import logging import os +import pytest +from pytest import approx import uuid from typing import Generator, Union -import pytest from langchain_core.documents import Document -from pytest import approx - from langchain_community.embeddings.openai import OpenAIEmbeddings from langchain_community.vectorstores.weaviate import Weaviate from tests.integration_tests.vectorstores.fake_embeddings import FakeEmbeddings diff --git a/libs/langchain/tests/integration_tests/retrievers/self_query/test_base.py b/libs/langchain/tests/integration_tests/retrievers/self_query/test_base.py index 768ee614e69e3..be1b24effc5cf 100644 --- a/libs/langchain/tests/integration_tests/retrievers/self_query/test_base.py +++ b/libs/langchain/tests/integration_tests/retrievers/self_query/test_base.py @@ -47,4 +47,3 @@ def test_weaviate() -> None: # Test the retriever retriever.get_relevant_documents("test") - print("Successfully passed test_weaviate") diff --git a/libs/langchain/tests/integration_tests/vectorstores/test_weaviate.py b/libs/langchain/tests/integration_tests/vectorstores/test_weaviate.py index 520f26dc9eeea..3314c7e8fb34c 100644 --- a/libs/langchain/tests/integration_tests/vectorstores/test_weaviate.py +++ b/libs/langchain/tests/integration_tests/vectorstores/test_weaviate.py @@ -1,4 +1,4 @@ -"""Test Weaviate V4 functionality. +"""Test Weaviate V4 functionality under libs/langchain/ # Launch the Weaviate pod cd tests/integration_tests/vectorstores/docker-compose @@ -11,7 +11,6 @@ import logging import os -import uuid from typing import Generator, Union import pytest @@ -19,7 +18,6 @@ from langchain_core.documents import Document from langchain_openai import OpenAIEmbeddings from langchain_weaviate.vectorstores import WeaviateVectorStore -from pytest import approx from weaviate.classes.config import DataType, Property from weaviate.classes.query import Filter @@ -70,6 +68,7 @@ def weaviate_client( host=weaviate_host, port=weaviate_port ) # Create the collection if not exists + # The collection name is assumed to be "test" throughout the test module if not weaviate_client.collections.exists("test"): weaviate_client.collections.create( name="test", properties=[Property(name="name", data_type=DataType.TEXT)]