-
Notifications
You must be signed in to change notification settings - Fork 99
Closed
Description
SQLAlchemy allows defining models as follows:
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class BaseModel(Base):
__abstract__ = True
id = Column(Integer, primary_key=True)
name = Column(String(50))
class MyModel(BaseModel):
__tablename__ = 'my-model'
whatever = Column(String)Then you can create new instances as expected:
MyModel(name='the name', whatever='something here')When doing that, Mypy reports:
error: Unexpected column "name" for model "MyModel"
It appears the stubs in this project don't let Mypy follow model inheritance?
This is with sqlalchemy-stubs==0.2
Metadata
Metadata
Assignees
Labels
No labels