replace db with sa to get typing support (#23240)
This commit is contained in:
parent
ff9fd0cdb2
commit
58608f51da
17 changed files with 623 additions and 613 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue