Describe the bug
Exception with INTERNAL ERROR: maximum semantic analysis iteration count reached
Expected behavior
A message like error: Name "Address" is not defined [name-defined]
To Reproduce
Type check the code below.
Obviously, there is not class Address. When removing the base class, the error is emitted as expected. Stumbled upon this problem when having a typo in a relation.
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
def test_soft():
Base = declarative_base()
class User(Base):
__tablename__ = "user"
id = Column(Integer, primary_key=True)
addresses: list[Address]
This is related to the mypy plugin. Since v2 will not use it it's unlikely that it will be fixed. PR are welcome though.
(The plugin code lives in the main sqlalchemy repo)
Describe the bug Exception with
INTERNAL ERROR: maximum semantic analysis iteration count reached
Expected behavior
A message like
error: Name "Address" is not defined [name-defined]
To Reproduce Type check the code below.
Obviously, there is not class
Address
. When removing the base class, the error is emitted as expected. Stumbled upon this problem when having a typo in a relation.Error
Versions.