Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix BenchmarkDatasetConfig sub_dataset nullable #524

Merged
merged 1 commit into from
Nov 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions backend/src/impl/db_utils/benchmark_db_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,12 @@ def generate_dataframe_from_sys_infos(
dataset_metadatas: list[DatasetMetadata] = []
for x in dataset_configs:
dataset_return = DatasetDBUtils.find_datasets(
dataset_name=x["dataset_name"], sub_dataset=x["sub_dataset"]
dataset_name=x["dataset_name"], sub_dataset=x.get("sub_dataset", None)
)
if dataset_return.total != 1:
raise ValueError(
f'Could not find dataset {x["dataset_name"]}, {x["sub_dataset"]}'
f"Could not find dataset "
f'{x["dataset_name"]}, {x.get("sub_dataset", None)}'
)
dataset_metadatas.append(dataset_return.datasets[0])

Expand Down Expand Up @@ -300,6 +301,8 @@ def generate_dataframe_from_sys_infos(
for df_key, df_arr in df_input.items():
if df_key in column_dict:
info = column_dict[df_key]
elif df_key == "sub_dataset":
info = None
elif df_key == "dataset_split":
info = "test"
elif df_key == "source_language":
Expand Down
7 changes: 4 additions & 3 deletions openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ openapi: "3.0.0"
info:
title: "ExplainaBoard"
description: "Backend APIs for ExplainaBoard"
version: "0.2.19"
version: "0.2.20"
contact:
email: "explainaboard@gmail.com"
license:
Expand Down Expand Up @@ -1398,14 +1398,15 @@ components:
properties:
dataset_name:
type: string
sub_dataset:
type: string
split:
type: string
metrics:
type: array
items:
$ref: '#/components/schemas/BenchmarkMetric'
sub_dataset:
type: string
nullable: true
additionalProperties: true
required: [dataset_name]

Expand Down