replace db with sa to get typing support (#23240)

This commit is contained in:
Asuka Minato 2025-08-03 00:54:23 +09:00 committed by GitHub
commit 58608f51da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 623 additions and 613 deletions

View file

@ -9,6 +9,7 @@ from typing import Any, Optional
from uuid import uuid4
import click
import sqlalchemy as sa
import tqdm
from flask import Flask, current_app
from sqlalchemy.orm import Session
@ -197,7 +198,7 @@ class PluginMigration:
"""
with Session(db.engine) as session:
rs = session.execute(
db.text(f"SELECT DISTINCT {column} FROM {table} WHERE tenant_id = :tenant_id"), {"tenant_id": tenant_id}
sa.text(f"SELECT DISTINCT {column} FROM {table} WHERE tenant_id = :tenant_id"), {"tenant_id": tenant_id}
)
result = []
for row in rs: