Skip to content

Commit 2096c58

Browse files
committed
Improved typing [skip ci]
1 parent b5c9e39 commit 2096c58

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

tests/test_sqlmodel.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import pytest
44
from sqlalchemy.exc import StatementError
55
from sqlmodel import Field, Index, Session, SQLModel, create_engine, delete, select, text
6-
from typing import Any
76

87
engine = create_engine('postgresql+psycopg2://localhost/pgvector_python_test')
98
with Session(engine) as session:
@@ -14,10 +13,10 @@ class Item(SQLModel, table=True):
1413
__tablename__ = 'sqlmodel_item' # type: ignore
1514

1615
id: int | None = Field(default=None, primary_key=True)
17-
embedding: Any = Field(default=None, sa_type=VECTOR(3)) # type: ignore
18-
half_embedding: Any = Field(default=None, sa_type=HALFVEC(3)) # type: ignore
19-
binary_embedding: Any = Field(default=None, sa_type=BIT(3)) # type: ignore
20-
sparse_embedding: Any = Field(default=None, sa_type=SPARSEVEC(3)) # type: ignore
16+
embedding: Vector | list[float] | None = Field(default=None, sa_type=VECTOR(3)) # type: ignore
17+
half_embedding: HalfVector | list[float] | None = Field(default=None, sa_type=HALFVEC(3)) # type: ignore
18+
binary_embedding: str | None = Field(default=None, sa_type=BIT(3)) # type: ignore
19+
sparse_embedding: SparseVector | list[float] | None = Field(default=None, sa_type=SPARSEVEC(3)) # type: ignore
2120

2221

2322
SQLModel.metadata.drop_all(engine)

0 commit comments

Comments
 (0)