mypy-fixed
Some checks failed
Deploy on push / deploy (push) Failing after 5s

This commit is contained in:
2025-07-31 19:27:58 +03:00
parent 809bda2b56
commit c80f3efc77
2 changed files with 19 additions and 9 deletions

View File

@@ -149,12 +149,13 @@ def create_table_if_not_exists(
inspector = inspect(connection)
if not inspector.has_table(model_cls.__tablename__):
# Use SQLAlchemy's built-in table creation instead of manual SQL generation
model_cls.__table__.create(bind=connection, checkfirst=False)
model_cls.__table__.create(bind=connection, checkfirst=False) # type: ignore[attr-defined]
logger.info(f"Created table: {model_cls.__tablename__}")
finally:
# Close connection only if we created it
if should_close:
connection.close()
if hasattr(connection, "close"):
connection.close() # type: ignore[attr-defined]
def get_column_names_without_virtual(model_cls: Type[DeclarativeBase]) -> list[str]: