Skip to content

Commit af99020

Browse files
committed
fix: 兼容 SQLAlchemy 的高版本写法
1 parent 236a901 commit af99020

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
SQLAlchemy~=1.4.32
2-
3-
tqdm~=4.64.0
4-
astor~=0.8.1
1+
SQLAlchemy==1.4.54
2+
tqdm==4.64.0
3+
astor==0.8.1
54
pyinstaller==6.11.1

language/python/extractor/src/core/storage.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import shutil
33
import sys
44

5-
from sqlalchemy import create_engine
5+
from sqlalchemy import create_engine, text
66
from sqlalchemy.orm import sessionmaker, scoped_session
77

88
from model.alias import Alias
@@ -124,7 +124,8 @@ def copy_db_file(dest_path):
124124
sql_statements = f.read()
125125
statements = sql_statements.split(";")
126126
for statement in statements:
127-
session.execute(statement)
127+
if statement.strip(): # 跳过空语句
128+
session.execute(text(statement))
128129
session.commit()
129130

130131
session.close()

0 commit comments

Comments
 (0)