the inspect() API changed in
https://github.com/sqlalchemy/sqlalchemy2-stubs/commit/
68f8417888456588714fcced1c6799f3eb00ff2d
to be more accurate which correctly appears to necessitate a
type check in Alembic AutogenContext.inspector() to ensure
"self.connection" isn't None
Change-Id: Icb3c73be62dc14d9a8f88e0723c3651b6628739a
@util.memoized_property
def inspector(self) -> "Inspector":
+ if self.connection is None:
+ raise TypeError(
+ "can't return inspector as this "
+ "AutogenContext has no database connection"
+ )
return inspect(self.connection)
@contextlib.contextmanager