Skip to content

Commit 3dc9cc5

Browse files
committed
reformat fixes
1 parent 97b387c commit 3dc9cc5

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

langchain_postgres/v2/vectorstores.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ async def aadd_images(
850850
) -> list[str]:
851851
"""Embed images and add to the table."""
852852
return await self._engine._run_as_async(
853-
self._PGVectorStore__vs.aadd_images(uris, metadatas, ids, **kwargs) # type: ignore
853+
self.__vs.aadd_images(uris, metadatas, ids, **kwargs) # type: ignore
854854
)
855855

856856
def add_images(
@@ -862,7 +862,7 @@ def add_images(
862862
) -> list[str]:
863863
"""Embed images and add to the table."""
864864
return self._engine._run_as_sync(
865-
self._PGVectorStore__vs.aadd_images(uris, metadatas, ids, **kwargs) # type: ignore
865+
self.__vs.aadd_images(uris, metadatas, ids, **kwargs) # type: ignore
866866
)
867867

868868
def similarity_search_image(
@@ -874,7 +874,7 @@ def similarity_search_image(
874874
) -> list[Document]:
875875
"""Return docs selected by similarity search on image."""
876876
return self._engine._run_as_sync(
877-
self._PGVectorStore__vs.asimilarity_search_image(
877+
self.__vs.asimilarity_search_image(
878878
image_uri, k, filter, **kwargs
879879
) # type: ignore
880880
)
@@ -888,7 +888,7 @@ async def asimilarity_search_image(
888888
) -> list[Document]:
889889
"""Return docs selected by similarity search on image_uri."""
890890
return await self._engine._run_as_async(
891-
self._PGVectorStore__vs.asimilarity_search_image(
891+
self.__vs.asimilarity_search_image(
892892
image_uri, k, filter, **kwargs
893893
) # type: ignore
894894
)

tests/unit_tests/v2/test_pg_vectorstore.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ async def test_aadd_docs(self, engine: PGEngine, vs: PGVectorStore) -> None:
225225
await aexecute(engine, f'TRUNCATE TABLE "{DEFAULT_TABLE}"')
226226

227227
async def test_aadd_images(
228-
self, engine_sync: PGVectorStore, image_uris: list[str]
228+
self, engine_sync: PGEngine, image_uris: list[str]
229229
) -> None:
230230
engine_sync.init_vectorstore_table(
231231
IMAGE_TABLE,
@@ -254,7 +254,7 @@ async def test_aadd_images(
254254
await aexecute(engine_sync, f'TRUNCATE TABLE "{IMAGE_TABLE}"')
255255

256256
async def test_add_images(
257-
self, engine_sync: PGVectorStore, image_uris: list[str]
257+
self, engine_sync: PGEngine, image_uris: list[str]
258258
) -> None:
259259
engine_sync.init_vectorstore_table(IMAGE_TABLE_SYNC, VECTOR_SIZE)
260260
vs = PGVectorStore.create_sync(

tests/unit_tests/v2/test_pg_vectorstore_search.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ async def test_asimilarity_search_by_vector(self, vs: PGVectorStore) -> None:
220220
assert result[0][0] == Document(page_content="foo", id=ids[0])
221221
assert result[0][1] == 0
222222

223-
async def test_asimilarity_search_image(self, image_vs, image_uris):
223+
async def test_asimilarity_search_image(self, image_vs: PGVectorStore, image_uris: list[str]) -> None:
224224
results = await image_vs.asimilarity_search_image(image_uris[0], k=1)
225225
assert len(results) == 1
226226
assert results[0].metadata["image_uri"] == image_uris[0]
@@ -441,7 +441,7 @@ def test_similarity_search_by_vector(self, vs_custom: PGVectorStore) -> None:
441441
assert result[0][0] == Document(page_content="foo", id=ids[0])
442442
assert result[0][1] == 0
443443

444-
def test_similarity_search_image(self, image_vs, image_uris):
444+
def test_similarity_search_image(self, image_vs: PGVectorStore, image_uris: list[str]) -> None:
445445
results = image_vs.similarity_search_image(image_uris[0], k=1)
446446
assert len(results) == 1
447447
assert results[0].metadata["image_uri"] == image_uris[0]

0 commit comments

Comments
 (0)