Skip to content

Commit

Permalink
fix(ChatData): ChatData (#694)
Browse files Browse the repository at this point in the history
1.empty table show bug fix;
  • Loading branch information
Aries-ckt authored Oct 19, 2023
2 parents a833e8b + 365eb0f commit 5282208
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pilot/scene/chat_db/auto_execute/out_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def parse_view_response(self, speak, data) -> str:

### tool out data to table view
data_loader = DbDataLoader()
if len(data) <= 1:
data.insert(0, ["result"])
if len(data) < 1:
data.insert(0, [])
df = pd.DataFrame(data[1:], columns=data[0])
if not CFG.NEW_SERVER_MODE and not CFG.SERVER_LIGHT_MODE:
table_style = """<style>
Expand Down
2 changes: 1 addition & 1 deletion pilot/scene/chat_db/data_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ def get_table_view_by_conn(self, data, speak):
import pandas as pd

### tool out data to table view
if len(data) <= 1:
if len(data) < 1:
data.insert(0, ["result"])
df = pd.DataFrame(data[1:], columns=data[0])
html_table = df.to_html(index=False, escape=False, sparsify=False)
Expand Down

0 comments on commit 5282208

Please sign in to comment.