Skip to content

Commit

Permalink
Merge pull request #792 from hubmapconsortium/Derek-Furst/dataset-typ…
Browse files Browse the repository at this point in the history
…e-validation-bypass

Created a temporary override in dataset type validator for datasets t…
  • Loading branch information
yuanzhou authored Jan 17, 2025
2 parents e13eb36 + 9c490d2 commit a0c943a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 0 additions & 4 deletions src/schema/provenance_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -667,10 +667,6 @@ ENTITIES:
description: "The activity that was performed."
dataset_type:
before_create_trigger: set_publication_dataset_type
before_property_create_validators:
- validate_recognized_dataset_type
before_property_update_validators:
- validate_recognized_dataset_type
type: string
generated: true
immutable: true
Expand Down
3 changes: 2 additions & 1 deletion src/schema/schema_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ def validate_recognized_dataset_type(property_key, normalized_entity_type, reque
# those square brackets are acceptable at the end of the string. Simply validate the start.
proposed_dataset_type_prefix = re.sub(pattern='(\S)\s\[.*\]$', repl=r'\1', string=new_data_dict['dataset_type'])
target_list = schema_manager.get_dataset_type_valueset_list()

# TODO This is a temporary bypass because the UBKG does not support publication as a dataset_type yet. Remove once its added
target_list.append("Publication")
if proposed_dataset_type_prefix not in target_list:
raise ValueError(f"Proposed Dataset dataset_type '{proposed_dataset_type_prefix}'"
f" is not recognized in the existing ontology."
Expand Down

0 comments on commit a0c943a

Please sign in to comment.