First Check
Commit to Help
Example Code
from sqlmodel import SQLModel, UniqueConstraint, select
class BookCollection(SQLModel, table=True):
user_nid: int
book_nid: int
UniqueConstraint(
BookCollection.user_nid, # Argument of type "int" cannot be assigned to parameter "columns" of type "str | Column[Any]" in function "__init__"
BookCollection.book_nid, # Argument of type "int" cannot be assigned to parameter "columns" of type "str | Column[Any]" in function "__init__"
name="uidx_book_collection_user_nid_book_nid",
)
# Cannot access member "not_in" for type "int"
select(BookCollection).where(BookCollection.book_nid.not_in([1, 2, 3]))
Description
Some APIs of sqlalchemy may still need a column type. Without that, a type checker will complain.
Currently, I'm using type: ignore to skip those.
Operating System
Linux, macOS
Operating System Details
No response
SQLModel Version
0.0.4
Python Version
3.8.6
Additional Context
No response
First Check
Commit to Help
Example Code
Description
Some APIs of sqlalchemy may still need a column type. Without that, a type checker will complain.
Currently, I'm using
type: ignoreto skip those.Operating System
Linux, macOS
Operating System Details
No response
SQLModel Version
0.0.4
Python Version
3.8.6
Additional Context
No response