Skip to content

Commit 9e4989c

Browse files
committed
run linter
1 parent 8617471 commit 9e4989c

File tree

8 files changed

+10
-12
lines changed

8 files changed

+10
-12
lines changed

langchain_postgres/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from importlib import metadata
22

33
from langchain_postgres.chat_message_histories import PostgresChatMessageHistory
4-
from langchain_postgres.v2.engine import Column, PGEngine, ColumnDict
54
from langchain_postgres.translator import PGVectorTranslator
5+
from langchain_postgres.v2.engine import Column, ColumnDict, PGEngine
66
from langchain_postgres.v2.vectorstores import PGVectorStore
77
from langchain_postgres.vectorstores import PGVector
88

langchain_postgres/utils/pgvector_migrator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ async def __aextract_pgvector_collection(
6868
if not rows:
6969
break
7070
yield [row._mapping for row in rows]
71-
except ValueError as e:
71+
except ValueError:
7272
raise ValueError(f"Collection, {collection_name} does not exist.")
7373
except SQLAlchemyError as e:
7474
raise ProgrammingError(

langchain_postgres/v2/async_vectorstore.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import copy
55
import json
6-
import re
76
import uuid
87
from typing import Any, Callable, Iterable, Optional, Sequence
98

@@ -834,7 +833,7 @@ async def is_valid_index(
834833
) -> bool:
835834
"""Check if index exists in the table."""
836835
index_name = index_name or self.table_name + DEFAULT_INDEX_NAME_SUFFIX
837-
query = f"""
836+
query = """
838837
SELECT tablename, indexname
839838
FROM pg_indexes
840839
WHERE tablename = :table_name AND schemaname = :schema_name AND indexname = :index_name;

langchain_postgres/v2/engine.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
import asyncio
44
from dataclasses import dataclass
55
from threading import Thread
6-
from typing import TYPE_CHECKING, Any, Awaitable, Optional, TypeVar, TypedDict, Union
6+
from typing import TYPE_CHECKING, Any, Awaitable, Optional, TypedDict, TypeVar, Union
77

88
from sqlalchemy import text
99
from sqlalchemy.engine import URL
1010
from sqlalchemy.ext.asyncio import AsyncEngine, create_async_engine
1111

1212
if TYPE_CHECKING:
13-
import asyncpg # type: ignore
13+
pass # type: ignore
1414

1515
T = TypeVar("T")
1616

langchain_postgres/vectorstores.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import enum
66
import logging
77
import uuid
8+
import warnings
89
from typing import (
910
Any,
1011
AsyncGenerator,
@@ -19,7 +20,6 @@
1920
Type,
2021
Union,
2122
)
22-
import warnings
2323
from typing import (
2424
cast as typing_cast,
2525
)

tests/unit_tests/v2/test_engine.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import uuid
33
from typing import AsyncIterator, Sequence
44

5-
import asyncpg # type: ignore
65
import pytest
76
import pytest_asyncio
87
from langchain_core.embeddings import DeterministicFakeEmbedding
@@ -11,7 +10,7 @@
1110
from sqlalchemy.ext.asyncio import create_async_engine
1211
from sqlalchemy.pool import NullPool
1312

14-
from langchain_postgres import Column, PGEngine, ColumnDict
13+
from langchain_postgres import Column, PGEngine
1514
from tests.utils import VECTORSTORE_CONNECTION_STRING as CONNECTION_STRING
1615

1716
DEFAULT_TABLE = "default" + str(uuid.uuid4()).replace("-", "_")
@@ -214,7 +213,7 @@ async def test_from_connection_string_url_error(
214213
) -> None:
215214
with pytest.raises(ValueError):
216215
PGEngine.from_connection_string(
217-
f"postgresql+pg8000://user:password@host:port/db_name",
216+
"postgresql+pg8000://user:password@host:port/db_name",
218217
)
219218

220219
async def test_column(self, engine: PGEngine) -> None:

tests/unit_tests/v2/test_indexes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import warnings
2+
23
import pytest
34

45
from langchain_postgres.v2.indexes import (

tests/unit_tests/v2/test_pg_vectorstore_from_methods.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
import pytest_asyncio
77
from langchain_core.documents import Document
88
from langchain_core.embeddings import DeterministicFakeEmbedding
9-
from sqlalchemy import VARCHAR, text
9+
from sqlalchemy import text
1010
from sqlalchemy.engine.row import RowMapping
11-
from sqlalchemy.ext.asyncio import create_async_engine
1211

1312
from langchain_postgres import Column, PGEngine, PGVectorStore
1413
from tests.utils import VECTORSTORE_CONNECTION_STRING as CONNECTION_STRING

0 commit comments

Comments
 (0)