Skip to content

Commit

Permalink
Skip smart update when language is updated
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaFrancis committed Jul 11, 2024
1 parent 02be848 commit a49d45d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions libs/libcommon/src/libcommon/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,5 @@
5000.0,
float("inf"),
)

YAML_FIELDS_TO_CHECK = ["dataset_info", "configs", "viewer", "language"]
12 changes: 6 additions & 6 deletions libs/libcommon/src/libcommon/orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit a49d45d

Please sign in to comment.