The SQLModel documentation tells us that we should define a mapped table as follows:
from typing import Optional
from sqlmodel import Field, SQLModel
class Hero(SQLModel, table=True):
id: Optional[int] = Field(default=None, primary_key=True)
name: str
secret_name: str
age: Optional[int] = None
Since the latest version 0.0.14, pylance is giving me the warning: "No parameter called 'table'".
Any ideas on how to resolve this for now? The code still runs if I use # type: ignore
, but this seems non-ideal in the long run.
Downgrading sqlmodel to 0.0.13 solved this for me. I'd say it's a bug in 0.0.14.