Skip to content

Commit

Permalink
Merge pull request #637 from hubmapconsortium/upload_and_dataset_stat…
Browse files Browse the repository at this point in the history
…us_add_incomplete

Upload and dataset status add incomplete
  • Loading branch information
yuanzhou authored Mar 11, 2024
2 parents 5fc3750 + b8f3872 commit c6c421a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/schema/provenance_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ ENTITIES:
- validate_dataset_status_value
- validate_status_changed
generated: true
description: "One of: New|Processing|QA|Published|Error|Hold|Invalid|Submitted"
description: "One of: New|Processing|Published|QA|Error|Hold|Invalid|Submitted|Incomplete"
before_create_trigger: set_dataset_status_new
after_create_trigger: set_status_history
after_update_trigger: set_status_history
Expand Down Expand Up @@ -959,7 +959,7 @@ ENTITIES:
- validate_status_changed
type: string
generated: true
description: "One of: New|Valid|Invalid|Error|Reorganized|Processing"
description: "One of: New|Valid|Invalid|Error|Reorganized|Processing|Submitted|Incomplete"
# Trigger method will set the status to "New" on create
before_create_trigger: set_upload_status_new
after_create_trigger: set_status_history
Expand Down
10 changes: 7 additions & 3 deletions src/schema/schema_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,9 @@ def validate_application_header_before_property_update(property_key, normalized_
"""
def validate_dataset_status_value(property_key, normalized_entity_type, request, existing_data_dict, new_data_dict):
# Use lowercase for comparison
accepted_status_values = ['new', 'processing', 'published', 'qa', 'error', 'hold', 'invalid', 'submitted']
accepted_status_values = [
'new', 'processing', 'published', 'qa', 'error', 'hold', 'invalid', 'submitted', 'incomplete'
]
new_status = new_data_dict[property_key].lower()

if new_status not in accepted_status_values:
Expand Down Expand Up @@ -456,7 +458,9 @@ def validate_retracted_dataset_sub_status_value(property_key, normalized_entity_
"""
def validate_upload_status_value(property_key, normalized_entity_type, request, existing_data_dict, new_data_dict):
# Use lowercase for comparison
accepted_status_values = ['new', 'valid', 'invalid', 'error', 'reorganized', 'processing', 'submitted']
accepted_status_values = [
'new', 'valid', 'invalid', 'error', 'reorganized', 'processing', 'submitted', 'incomplete'
]
new_status = new_data_dict[property_key].lower()

if new_status not in accepted_status_values:
Expand All @@ -481,7 +485,7 @@ def validate_upload_status_value(property_key, normalized_entity_type, request,
"""
def validate_sample_category(property_key, normalized_entity_type, request, existing_data_dict, new_data_dict):
defined_tissue_types = ["organ", "block", "section", "suspension"]
sample_category = new_data_dict[property_key]
sample_category = new_data_dict[property_key].lower()

if sample_category not in defined_tissue_types:
raise ValueError(f"Invalid sample_category: {sample_category}")
Expand Down

0 comments on commit c6c421a

Please sign in to comment.