From f6ce4dfd0e06631067d8e5e751d01e3875a57b39 Mon Sep 17 00:00:00 2001 From: Lyuyang Hu Date: Tue, 18 Oct 2022 16:11:11 -0400 Subject: [PATCH] db_schema: system_info.{source,target}_language -> {source,target}_language --- backend/src/impl/db_utils/system_db_utils.py | 4 ++-- .../SystemsTable/SystemTableContent.tsx | 8 ++------ openapi/openapi.yaml | 20 ++++++++++++------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/backend/src/impl/db_utils/system_db_utils.py b/backend/src/impl/db_utils/system_db_utils.py index 577301a0..87f398ac 100644 --- a/backend/src/impl/db_utils/system_db_utils.py +++ b/backend/src/impl/db_utils/system_db_utils.py @@ -240,9 +240,9 @@ def find_systems( if subdataset_name: search_conditions.append({"system_info.sub_dataset_name": subdataset_name}) if source_language: - search_conditions.append({"system_info.source_language": source_language}) + search_conditions.append({"source_language": source_language}) if target_language: - search_conditions.append({"system_info.target_language": target_language}) + search_conditions.append({"target_language": target_language}) if split: search_conditions.append({"system_info.dataset_split": split}) if creator: diff --git a/frontend/src/components/SystemsTable/SystemTableContent.tsx b/frontend/src/components/SystemsTable/SystemTableContent.tsx index 051b6315..f972c2d5 100644 --- a/frontend/src/components/SystemsTable/SystemTableContent.tsx +++ b/frontend/src/components/SystemsTable/SystemTableContent.tsx @@ -138,20 +138,16 @@ export function SystemTableContent({ render: (_, record) => record.system_info.dataset_split || "unspecified", }, { - dataIndex: ["system_info", "source_language"], + dataIndex: "source_language", width: 100, title: "Input Lang", align: "center", - render: (_, record) => - record.system_info.source_language || "unspecified", }, { - dataIndex: ["system_info", "target_language"], + dataIndex: "target_language", width: 100, title: "Output Lang", align: "center", - render: (_, record) => - record.system_info.target_language || "unspecified", }, ...metricColumns, { diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index c73127dc..70c9a281 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -957,6 +957,12 @@ components: type: string is_private: type: boolean + source_language: + type: string + example: en + target_language: + type: string + example: en system_info: $ref: "#/components/schemas/SystemInfo" metric_stats: @@ -998,13 +1004,13 @@ components: description: | a place to store arbitrary system details you want to remember required: - [ - system_id, - system_name, - is_private, - system_info, - metric_stats, - ] + - system_id + - system_name + - is_private + - source_language + - target_language + - system_info + - metric_stats - $ref: "#/components/schemas/Time" DatasetFeature: