mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-02 01:27:14 +00:00
bugfix(ChatData): ChatData
1.empty table show bug fix;
This commit is contained in:
@@ -36,8 +36,8 @@ class DbChatOutputParser(BaseOutputParser):
|
|||||||
|
|
||||||
### tool out data to table view
|
### tool out data to table view
|
||||||
data_loader = DbDataLoader()
|
data_loader = DbDataLoader()
|
||||||
if len(data) <= 1:
|
if len(data) < 1:
|
||||||
data.insert(0, ["result"])
|
data.insert(0, [])
|
||||||
df = pd.DataFrame(data[1:], columns=data[0])
|
df = pd.DataFrame(data[1:], columns=data[0])
|
||||||
if not CFG.NEW_SERVER_MODE and not CFG.SERVER_LIGHT_MODE:
|
if not CFG.NEW_SERVER_MODE and not CFG.SERVER_LIGHT_MODE:
|
||||||
table_style = """<style>
|
table_style = """<style>
|
||||||
|
@@ -3,7 +3,7 @@ class DbDataLoader:
|
|||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
### tool out data to table view
|
### tool out data to table view
|
||||||
if len(data) <= 1:
|
if len(data) < 1:
|
||||||
data.insert(0, ["result"])
|
data.insert(0, ["result"])
|
||||||
df = pd.DataFrame(data[1:], columns=data[0])
|
df = pd.DataFrame(data[1:], columns=data[0])
|
||||||
html_table = df.to_html(index=False, escape=False, sparsify=False)
|
html_table = df.to_html(index=False, escape=False, sparsify=False)
|
||||||
|
Reference in New Issue
Block a user