Skip to content

Commit 938372f

Browse files
authored
fix BenchmarkDatasetConfig sub_dataset nullable (#524)
1 parent 7c108a0 commit 938372f

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

backend/src/impl/db_utils/benchmark_db_utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,12 @@ def generate_dataframe_from_sys_infos(
205205
dataset_metadatas: list[DatasetMetadata] = []
206206
for x in dataset_configs:
207207
dataset_return = DatasetDBUtils.find_datasets(
208-
dataset_name=x["dataset_name"], sub_dataset=x["sub_dataset"]
208+
dataset_name=x["dataset_name"], sub_dataset=x.get("sub_dataset", None)
209209
)
210210
if dataset_return.total != 1:
211211
raise ValueError(
212-
f'Could not find dataset {x["dataset_name"]}, {x["sub_dataset"]}'
212+
f"Could not find dataset "
213+
f'{x["dataset_name"]}, {x.get("sub_dataset", None)}'
213214
)
214215
dataset_metadatas.append(dataset_return.datasets[0])
215216

@@ -300,6 +301,8 @@ def generate_dataframe_from_sys_infos(
300301
for df_key, df_arr in df_input.items():
301302
if df_key in column_dict:
302303
info = column_dict[df_key]
304+
elif df_key == "sub_dataset":
305+
info = None
303306
elif df_key == "dataset_split":
304307
info = "test"
305308
elif df_key == "source_language":

openapi/openapi.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ openapi: "3.0.0"
22
info:
33
title: "ExplainaBoard"
44
description: "Backend APIs for ExplainaBoard"
5-
version: "0.2.19"
5+
version: "0.2.20"
66
contact:
77
88
license:
@@ -1398,14 +1398,15 @@ components:
13981398
properties:
13991399
dataset_name:
14001400
type: string
1401-
sub_dataset:
1402-
type: string
14031401
split:
14041402
type: string
14051403
metrics:
14061404
type: array
14071405
items:
14081406
$ref: '#/components/schemas/BenchmarkMetric'
1407+
sub_dataset:
1408+
type: string
1409+
nullable: true
14091410
additionalProperties: true
14101411
required: [dataset_name]
14111412

0 commit comments

Comments
 (0)