Skip to content

Commit 69bc206

Browse files
committed
feat: support Elasticsearch datasource #108
1 parent db0ab2c commit 69bc206

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

backend/apps/db/db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,4 +434,4 @@ def exec_sql(ds: CoreDatasource | AssistantOutDsSchema, sql: str, origin_column=
434434
return {"fields": columns, "data": result_list,
435435
"sql": bytes.decode(base64.b64encode(bytes(sql, 'utf-8')))}
436436
except Exception as ex:
437-
raise ParseSQLResultError(str(ex))
437+
raise Exception(str(ex))

backend/apps/db/es_engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def get_es_fields(conf: DatasourceConf, table_name: str):
6363
def get_es_data(conf: DatasourceConf, sql: str, table_name: str):
6464
r = requests.post(f"{conf.host}/_sql/translate", json={"query": sql})
6565
if r.json().get('error'):
66-
raise BaseException(f'{json.dumps(r.json())}')
66+
print(json.dumps(r.json()))
6767

6868
es_client = get_es_connect(conf)
6969
response = es_client.search(

0 commit comments

Comments
 (0)