Skip to content

Commit a4efa89

Browse files
committed
x
1 parent 7eac67a commit a4efa89

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

langchain_postgres/vectorstores.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,11 @@ async def aadd_texts(
847847
await self.__apost_init__() # Lazy async init
848848
embeddings = await self.embedding_function.aembed_documents(list(texts))
849849
return await self.aadd_embeddings(
850-
texts=texts, embeddings=embeddings, metadatas=metadatas, ids=ids, **kwargs
850+
texts=list(texts),
851+
embeddings=embeddings,
852+
metadatas=metadatas,
853+
ids=ids,
854+
**kwargs,
851855
)
852856

853857
def similarity_search(
@@ -2253,7 +2257,7 @@ async def aget_by_ids(self, ids: Sequence[str], /) -> List[Document]:
22532257
.filter(*filter_by)
22542258
)
22552259

2256-
results: List[Any] = (await session.execute(stmt)).scalars().all()
2260+
results: Sequence[Any] = (await session.execute(stmt)).scalars().all()
22572261

22582262
for result in results:
22592263
documents.append(

tests/unit_tests/test_vectorstore_standard_tests.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,26 @@
55
ReadWriteTestSuite,
66
)
77

8-
from tests.unit_tests.test_vectorstore import aget_vectorstore, get_vectorstore
8+
from tests.unit_tests.test_vectorstore import get_vectorstore, aget_vectorstore
99

1010

1111
class TestSync(ReadWriteTestSuite):
1212
@pytest.fixture()
1313
def vectorstore(self) -> VectorStore:
1414
"""Get an empty vectorstore for unit tests."""
15-
with get_vectorstore(embedding=self.get_embeddings()) as vectorstore:
16-
vectorstore.drop_tables()
17-
vectorstore.create_tables_if_not_exists()
18-
vectorstore.create_collection()
19-
yield vectorstore
15+
with get_vectorstore(embedding=self.get_embeddings()) as vstore:
16+
vstore.drop_tables()
17+
vstore.create_tables_if_not_exists()
18+
vstore.create_collection()
19+
yield vstore
2020

2121

2222
class TestAsync(AsyncReadWriteTestSuite):
2323
@pytest.fixture()
2424
async def vectorstore(self) -> VectorStore:
2525
"""Get an empty vectorstore for unit tests."""
26-
async with aget_vectorstore(embedding=self.get_embeddings()) as vectorstore:
27-
await vectorstore.adrop_tables()
28-
await vectorstore.acreate_tables_if_not_exists()
29-
await vectorstore.acreate_collection()
30-
yield vectorstore
26+
async with aget_vectorstore(embedding=self.get_embeddings()) as vstore:
27+
await vstore.adrop_tables()
28+
await vstore.acreate_tables_if_not_exists()
29+
await vstore.acreate_collection()
30+
yield vstore

0 commit comments

Comments
 (0)