mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-05 20:58:25 +00:00
fix integration test imports (#9669)
This commit is contained in:
parent
cbaea8d63b
commit
342087bdfa
@ -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()
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user