Skip to content

Commit

Permalink
Convert the type of the result returned by the SQL Editor query (#647)
Browse files Browse the repository at this point in the history
Convert the SQL editor execution result to Tuple, otherwise FastAPI will
report an error.
fastapi: 0.99.1
DB-GPT: main branch
  • Loading branch information
csunny authored Oct 7, 2023
2 parents e382fbd + 13a7508 commit 85e32f7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pilot/openapi/api_v1/editor/api_editor_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ async def editor_sql_run(run_param: dict = Body()):
try:
start_time = time.time() * 1000
colunms, sql_result = conn.query_ex(sql)
# 转换结果类型
sql_result = [tuple(x) for x in sql_result]
# 计算执行耗时
end_time = time.time() * 1000
sql_run_data: SqlRunData = SqlRunData(
Expand Down

0 comments on commit 85e32f7

Please sign in to comment.