Running the SQLAlchemy inspect method on an existing MySQL server on a table with a column with an empty comment field is returning comment=None so I guess comment to be Optional[str] but mypy output complains that it needs to be str. Actually I don't know why since the repo code shows:
from sqlalchemy import Column
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class MyTable(Base):
id = Column('id', comment=None)
Running the SQLAlchemy
inspect
method on an existing MySQL server on a table with a column with an empty comment field is returningcomment=None
so I guesscomment
to beOptional[str]
but mypy output complains that it needs to bestr
. Actually I don't know why since the repo code shows:https://github.com/dropbox/sqlalchemy-stubs/blob/80f89322c3a58c1a8c19588b17869c5f49a1e72b/sqlalchemy-stubs/sql/schema.pyi#L88
Here is a MWE:
and output: