mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-07 05:30:39 +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
|
import pytest
|
||||||
|
|
||||||
from langchain.document_loaders import PolarsDataFrameLoader
|
from langchain.document_loaders import PolarsDataFrameLoader
|
||||||
from langchain.schema import Document
|
from langchain.schema import Document
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
import polars as pl
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def sample_data_frame() -> pl.DataFrame:
|
def sample_data_frame() -> pl.DataFrame:
|
||||||
|
import polars as pl
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
"text": ["Hello", "World"],
|
"text": ["Hello", "World"],
|
||||||
"author": ["Alice", "Bob"],
|
"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(
|
def test_load_converts_dataframe_columns_to_document_metadata(
|
||||||
sample_data_frame: pl.DataFrame,
|
sample_data_frame: pl.DataFrame,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
import polars as pl
|
||||||
|
|
||||||
loader = PolarsDataFrameLoader(sample_data_frame)
|
loader = PolarsDataFrameLoader(sample_data_frame)
|
||||||
docs = loader.load()
|
docs = loader.load()
|
||||||
|
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
"""Test Epsilla functionality."""
|
"""Test Epsilla functionality."""
|
||||||
from pyepsilla import vectordb
|
|
||||||
|
|
||||||
from langchain.vectorstores import Epsilla
|
from langchain.vectorstores import Epsilla
|
||||||
from tests.integration_tests.vectorstores.fake_embeddings import (
|
from tests.integration_tests.vectorstores.fake_embeddings import (
|
||||||
FakeEmbeddings,
|
FakeEmbeddings,
|
||||||
@ -9,6 +7,8 @@ from tests.integration_tests.vectorstores.fake_embeddings import (
|
|||||||
|
|
||||||
|
|
||||||
def _test_from_texts() -> Epsilla:
|
def _test_from_texts() -> Epsilla:
|
||||||
|
from pyepsilla import vectordb
|
||||||
|
|
||||||
embeddings = FakeEmbeddings()
|
embeddings = FakeEmbeddings()
|
||||||
client = vectordb.Client()
|
client = vectordb.Client()
|
||||||
return Epsilla.from_texts(fake_texts, embeddings, client)
|
return Epsilla.from_texts(fake_texts, embeddings, client)
|
||||||
@ -22,6 +22,8 @@ def test_epsilla() -> None:
|
|||||||
|
|
||||||
|
|
||||||
def test_epsilla_add_texts() -> None:
|
def test_epsilla_add_texts() -> None:
|
||||||
|
from pyepsilla import vectordb
|
||||||
|
|
||||||
embeddings = FakeEmbeddings()
|
embeddings = FakeEmbeddings()
|
||||||
client = vectordb.Client()
|
client = vectordb.Client()
|
||||||
db = Epsilla(client, embeddings)
|
db = Epsilla(client, embeddings)
|
||||||
|
Loading…
Reference in New Issue
Block a user