Skip to content

Commit

Permalink
fix bugs: display case_name and case_description
Browse files Browse the repository at this point in the history
Signed-off-by: min.tian <[email protected]>
  • Loading branch information
alwayslove2013 authored and XuanYang-cn committed Jun 21, 2023
1 parent 59e67ca commit 5c3d135
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions vectordb_bench/backend/cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ def case_name(self) -> str:
if c is not None:
return c().name
raise ValueError("Case unsupported")

@property
def case_description(self) -> str:
c = self.case_cls
if c is not None:
return c().description
raise ValueError("Case unsupported")


class CaseLabel(Enum):
Expand Down
4 changes: 2 additions & 2 deletions vectordb_bench/frontend/components/run_test/caseSelector.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def caseSelector(st, activedDbList):


def caseItem(st, allCaseConfigs, case: CaseType, activedDbList):
selected = st.checkbox(case.casename)
selected = st.checkbox(case.case_name)
st.markdown(
f"<div style='color: #1D2939; margin: -8px 0 20px {CHECKBOX_INDENT}px; font-size: 14px;'>{case.get()().description}</div>",
f"<div style='color: #1D2939; margin: -8px 0 20px {CHECKBOX_INDENT}px; font-size: 14px;'>{case.case_description}</div>",
unsafe_allow_html=True,
)

Expand Down

0 comments on commit 5c3d135

Please sign in to comment.