fix integration test imports (#9669)

This commit is contained in:
Bagatur 2023-08-23 16:47:01 -07:00 committed by GitHub
parent cbaea8d63b
commit 342087bdfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View File

@ -1,12 +1,18 @@
import polars as pl
from typing import TYPE_CHECKING
import pytest
from langchain.document_loaders import PolarsDataFrameLoader
from langchain.schema import Document
if TYPE_CHECKING:
import polars as pl
@pytest.fixture
def sample_data_frame() -> pl.DataFrame:
import polars as pl
data = {
"text": ["Hello", "World"],
"author": ["Alice", "Bob"],
@ -26,6 +32,8 @@ def test_load_returns_list_of_documents(sample_data_frame: pl.DataFrame) -> None
def test_load_converts_dataframe_columns_to_document_metadata(
sample_data_frame: pl.DataFrame,
) -> None:
import polars as pl
loader = PolarsDataFrameLoader(sample_data_frame)
docs = loader.load()

View File

@ -1,6 +1,4 @@
"""Test Epsilla functionality."""
from pyepsilla import vectordb
from langchain.vectorstores import Epsilla
from tests.integration_tests.vectorstores.fake_embeddings import (
FakeEmbeddings,
@ -9,6 +7,8 @@ from tests.integration_tests.vectorstores.fake_embeddings import (
def _test_from_texts() -> Epsilla:
from pyepsilla import vectordb
embeddings = FakeEmbeddings()
client = vectordb.Client()
return Epsilla.from_texts(fake_texts, embeddings, client)
@ -22,6 +22,8 @@ def test_epsilla() -> None:
def test_epsilla_add_texts() -> None:
from pyepsilla import vectordb
embeddings = FakeEmbeddings()
client = vectordb.Client()
db = Epsilla(client, embeddings)