perf: Optimize DataEase integration with Advanced Assistant

This commit is contained in:
fit2cloud-chenyw
2026-01-24 17:44:37 +08:00
committed by fit2cloud-chenyw
parent e626d13971
commit b9ce9d3ddf
6 changed files with 30 additions and 10 deletions
+1 -1
View File
@@ -195,7 +195,7 @@ async def ds(session: SessionDep, current_assistant: CurrentAssistant):
out_ds_instance: AssistantOutDs = AssistantOutDsFactory.get_instance(current_assistant)
return [
{
"id": ds.id,
"id": str(ds.id),
"name": ds.name,
"description": ds.description or ds.comment,
"type": ds.type,
+7 -4
View File
@@ -240,10 +240,13 @@ class AssistantOutDs:
except Exception as e:
raise Exception(
f"Failed to encrypt {attr} for datasource {ds_dict.get('name')}, error: {str(e)}")
for attr in attr_list:
if attr in ds_dict:
id_marker += str(ds_dict.get(attr, '')) + '--sqlbot--'
id = string_to_numeric_hash(id_marker)
id = ds_dict.get('id', None)
if not id:
for attr in attr_list:
if attr in ds_dict:
id_marker += str(ds_dict.get(attr, '')) + '--sqlbot--'
id = string_to_numeric_hash(id_marker)
db_schema = ds_dict.get('schema', ds_dict.get('db_schema', ''))
ds_dict.pop("schema", None)
return AssistantOutDsSchema(**{**ds_dict, "id": id, "db_schema": db_schema})