Skip to content

Commit 4a99efc

Browse files
committed
Improved typing [skip ci]
1 parent 23d287a commit 4a99efc

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/test_psycopg.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
from pgvector import Bit, HalfVector, SparseVector, Vector
22
from pgvector.psycopg import register_vector, register_vector_async
33
import psycopg
4+
from psycopg import Connection, AsyncConnection
45
from psycopg_pool import ConnectionPool, AsyncConnectionPool
56
import pytest
7+
from typing import Any
68

79
try:
810
import numpy as np
@@ -184,7 +186,7 @@ def test_vector_array(self):
184186
assert res[0][1] == embeddings[1]
185187

186188
def test_pool(self):
187-
def configure(conn):
189+
def configure(conn: Connection[Any]):
188190
register_vector(conn)
189191

190192
pool = ConnectionPool(conninfo='postgres://localhost/pgvector_python_test', open=True, configure=configure)
@@ -216,7 +218,7 @@ async def test_async(self):
216218

217219
@pytest.mark.asyncio
218220
async def test_async_pool(self):
219-
async def configure(conn):
221+
async def configure(conn: AsyncConnection[Any]):
220222
await register_vector_async(conn)
221223

222224
pool = AsyncConnectionPool(conninfo='postgres://localhost/pgvector_python_test', open=False, configure=configure)

0 commit comments

Comments
 (0)