Skip to content
Snippets Groups Projects
Unverified Commit 4fa768e7 authored by KevinHuSh's avatar KevinHuSh Committed by GitHub
Browse files

fix bug #314 (#317)

### What problem does this PR solve?

Issue link:#314

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
parent f6c72040
No related branches found
No related tags found
No related merge requests found
...@@ -358,6 +358,8 @@ def use_sql(question, field_map, tenant_id, chat_mdl): ...@@ -358,6 +358,8 @@ def use_sql(question, field_map, tenant_id, chat_mdl):
rows = ["|" + rows = ["|" +
"|".join([rmSpace(str(r[i])) for i in clmn_idx]).replace("None", " ") + "|".join([rmSpace(str(r[i])) for i in clmn_idx]).replace("None", " ") +
"|" for r in tbl["rows"]] "|" for r in tbl["rows"]]
rows = "\n".join([r + f" ##{ii}$$ |" for ii, r in enumerate(rows)])
rows = re.sub(r"T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+Z)?\|", "|", rows)
if not docid_idx or not docnm_idx: if not docid_idx or not docnm_idx:
chat_logger.warning("SQL missing field: " + sql) chat_logger.warning("SQL missing field: " + sql)
return { return {
...@@ -365,8 +367,6 @@ def use_sql(question, field_map, tenant_id, chat_mdl): ...@@ -365,8 +367,6 @@ def use_sql(question, field_map, tenant_id, chat_mdl):
"reference": {"chunks": [], "doc_aggs": []} "reference": {"chunks": [], "doc_aggs": []}
} }
rows = "\n".join([r + f" ##{ii}$$ |" for ii, r in enumerate(rows)])
rows = re.sub(r"T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+Z)?\|", "|", rows)
docid_idx = list(docid_idx)[0] docid_idx = list(docid_idx)[0]
docnm_idx = list(docnm_idx)[0] docnm_idx = list(docnm_idx)[0]
doc_aggs = {} doc_aggs = {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment