With mypy > 0.770 ORM models __init__ parameters are not recognized
Here's a minimal reproducable
# example.py
from typing import TYPE_CHECKING
from sqlalchemy import BigInteger, Text, Column, MetaData
from sqlalchemy.ext.declarative import declarative_base
Meta = MetaData()
Base = declarative_base(metadata=Meta)
class Book(Base):
__tablename__ = "book"
id = Column(BigInteger, primary_key=True)
title = Column(Text, nullable=False)
book = Book(title="some title") # this is line 21
The output of mypy example.py is
# example.py:21: error: Unexpected keyword argument "title" for "Book"
I'm happy to take a swing at resolving (admittedly might not succeed) if someone could give me a nudge in the right direction.
Version Info:
OS: macOS Catalina 10.15.14
Python: 3.8.6
Mypy: 0.790 (same issue exists in 0.780, 0.781, and 0.782)
With
mypy > 0.770
ORM models__init__
parameters are not recognizedHere's a minimal reproducable
The output of
mypy example.py
isI'm happy to take a swing at resolving (admittedly might not succeed) if someone could give me a nudge in the right direction.
Version Info:
OS: macOS Catalina 10.15.14 Python: 3.8.6 Mypy: 0.790 (same issue exists in 0.780, 0.781, and 0.782)