From a49d45d93929e26c4a02e758e2c86ddac523d731 Mon Sep 17 00:00:00 2001 From: Andrea Soria Date: Thu, 11 Jul 2024 11:56:18 -0400 Subject: [PATCH] Skip smart update when language is updated --- libs/libcommon/src/libcommon/constants.py | 2 ++ libs/libcommon/src/libcommon/orchestrator.py | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/libs/libcommon/src/libcommon/constants.py b/libs/libcommon/src/libcommon/constants.py index a38e61e504..6ebfd4f781 100644 --- a/libs/libcommon/src/libcommon/constants.py +++ b/libs/libcommon/src/libcommon/constants.py @@ -103,3 +103,5 @@ 5000.0, float("inf"), ) + +YAML_FIELDS_TO_CHECK = ["dataset_info", "configs", "viewer", "language"] diff --git a/libs/libcommon/src/libcommon/orchestrator.py b/libs/libcommon/src/libcommon/orchestrator.py index 53fe0858c9..b5fef81d87 100644 --- a/libs/libcommon/src/libcommon/orchestrator.py +++ b/libs/libcommon/src/libcommon/orchestrator.py @@ -19,6 +19,7 @@ DATASET_CONFIG_NAMES_KIND, DEFAULT_DIFFICULTY_MAX, DIFFICULTY_BONUS_BY_FAILED_RUNS, + YAML_FIELDS_TO_CHECK, ) from libcommon.dtos import JobInfo, JobResult, Priority from libcommon.processing_graph import ProcessingGraph, ProcessingStep, ProcessingStepDoesNotExist, processing_graph @@ -882,12 +883,11 @@ def __post_init__(self) -> None: }: # TODO: maybe support .huggingface.yaml later raise SmartUpdateImpossibleBecauseOfUpdatedFiles(", ".join(self.files_impacted_by_commit)[:1000]) self.updated_yaml_fields_in_dataset_card = self.get_updated_yaml_fields_in_dataset_card() - if "dataset_info" in self.updated_yaml_fields_in_dataset_card: - raise SmartUpdateImpossibleBecauseOfUpdatedYAMLField("dataset_info") - if "configs" in self.updated_yaml_fields_in_dataset_card: - raise SmartUpdateImpossibleBecauseOfUpdatedYAMLField("configs") - if "viewer" in self.updated_yaml_fields_in_dataset_card: - raise SmartUpdateImpossibleBecauseOfUpdatedYAMLField("viewer") + + for yaml_field in YAML_FIELDS_TO_CHECK: + if yaml_field in self.updated_yaml_fields_in_dataset_card: + raise SmartUpdateImpossibleBecauseOfUpdatedYAMLField(yaml_field) + # We update the cache entries and the storage (assets + cached assets) # We don't update the jobs because they might be creating artifacts that won't be updated by this code, # so we let them finish and restart later.