"No parameter named table" in SQLModel

169 Views Asked by At

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'".

enter image description here

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.

1

There are 1 best solutions below

2
On

Downgrading sqlmodel to 0.0.13 solved this for me. I'd say it's a bug in 0.0.14.