fix: remove ibm-db dependency and refactor import order (#10330)

### What problem does this PR solve?
issue: 
#10326
change:
 remove ibm-db dependency and refactor import order

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
buua436
2025-09-28 12:19:32 +08:00
committed by GitHub
parent fc56217eb3
commit 59cb0eb8bc
3 changed files with 1 additions and 30 deletions

View File

@ -21,7 +21,6 @@ import pandas as pd
import pymysql
import psycopg2
import pyodbc
import ibm_db
from agent.tools.base import ToolParamBase, ToolBase, ToolMeta
from api.utils.api_utils import timeout
@ -125,6 +124,7 @@ class ExeSQL(ToolBase, ABC):
)
db = pyodbc.connect(conn_str)
elif self._param.db_type == 'IBM DB2':
import ibm_db
conn_str = (
f"DATABASE={self._param.database};"
f"HOSTNAME={self._param.host};"