You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a column type is not directly using an SA column class but instead an indirection is in place, the column is not added to __init__ and mypy complains about an invalid argument.
fromsqlalchemy.ormimportdeclarative_basefromsqlalchemyimportColumn, StringBase=declarative_base()
classDummyTable(Base):
id=Column(String, primary_key=True)
# This causes the problem# I stumbled upon this in my code with an ENUM(...) beeing used in multiple placesMyString=StringclassDummyTable2(Base):
id=Column(MyString, primary_key=True)
DummyTable(id="wer")
# error: Unexpected keyword argument "id" for "DummyTable2" [call-arg]DummyTable2(id="wer")
Error
foo.py:16: error: Unexpected keyword argument "id" for "DummyTable2" [call-arg]
DummyTable2(id="wer")
^
Found 1 error in 1 file (checked 1 source file)
Describe the bug
When a column type is not directly using an SA column class but instead an indirection is in place, the column is not added to
__init__
and mypy complains about an invalid argument.Maybe (or maybe not) related to #141.
Expected behavior
No error.
To Reproduce
Error
Versions.
mypy==0.931
SQLAlchemy==1.4.31
sqlalchemy2-stubs==0.0.2a19
The text was updated successfully, but these errors were encountered: