Skip to content

Commit 206590d

Browse files
authored
Merge pull request #1011 from hubmapconsortium/Derek-Furst/status-approved
added new valid status 'approval'
2 parents aef89a9 + cb63db2 commit 206590d

8 files changed

Lines changed: 22 additions & 15 deletions

File tree

entity-api-spec.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,8 @@ components:
644644
- Invalid
645645
- Submitted
646646
- Incomplete
647-
description: 'One of: New|Processing|Published|QA|Error|Hold|Invalid|Submitted|Incomplete'
647+
- Approval
648+
description: 'One of: New|Processing|Published|QA|Error|Hold|Invalid|Submitted|Incomplete|Approval'
648649
title:
649650
type: string
650651
description: 'The dataset title.'
@@ -883,7 +884,7 @@ components:
883884
- Reorganized
884885
- Processing
885886
- Submitted
886-
- Imcomplete
887+
- Incomplete
887888
description: 'One of: New|Valid|Invalid|Error|Reorganized|Processing|Submitted|Incomplete'
888889
validation_message:
889890
type: string
@@ -1098,8 +1099,9 @@ components:
10981099
- Hold
10991100
- Invalid
11001101
- Submitted
1101-
- Imcomplete
1102-
description: 'One of: New|Processing|Published|QA|Error|Hold|Invalid|Submitted|Incomplete'
1102+
- Incomplete
1103+
- Approval
1104+
description: 'One of: New|Processing|Published|QA|Error|Hold|Invalid|Submitted|Incomplete|Approval'
11031105
title:
11041106
type: string
11051107
description: 'The Publication title.'

src/app.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2105,8 +2105,9 @@ def get_siblings(id):
21052105
include_revisions = request.args.get('include-old-revisions')
21062106
if status is not None:
21072107
status = status.lower()
2108-
if status not in ['new', 'processing', 'published', 'qa', 'error', 'hold', 'invalid', 'submitted']:
2109-
bad_request_error("Invalid Dataset Status. Must be 'new', 'qa', or 'published' Case-Insensitive")
2108+
allowed_statuses = ['new', 'processing', 'published', 'qa', 'error', 'hold', 'invalid', 'submitted', 'approval']
2109+
if status not in allowed_statuses:
2110+
bad_request_error(f"Invalid Dataset Status. Must be one of: {', '.join(allowed_statuses)}")
21102111
if property_key is not None:
21112112
property_key = property_key.lower()
21122113
result_filtering_accepted_property_keys = ['uuid']
@@ -2239,8 +2240,9 @@ def get_tuplets(id):
22392240
status = request.args.get('status')
22402241
if status is not None:
22412242
status = status.lower()
2242-
if status not in ['new', 'processing', 'published', 'qa', 'error', 'hold', 'invalid', 'submitted']:
2243-
bad_request_error("Invalid Dataset Status. Must be 'new', 'qa', or 'published' Case-Insensitive")
2243+
allowed_statuses = ['new', 'processing', 'published', 'qa', 'error', 'hold', 'invalid', 'submitted', 'approval']
2244+
if status not in allowed_statuses:
2245+
bad_request_error(f"Invalid Dataset Status. Must be one of: {', '.join(allowed_statuses)}")
22442246
if property_key is not None:
22452247
property_key = property_key.lower()
22462248
result_filtering_accepted_property_keys = ['uuid']

src/schema/provenance_schema.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ ENTITIES:
408408
- validate_dataset_not_component
409409
generated: true
410410
indexed: true
411-
description: "One of: New|Processing|Published|QA|Error|Hold|Invalid|Submitted|Incomplete"
411+
description: "One of: New|Processing|Published|QA|Error|Hold|Invalid|Submitted|Incomplete|Approval"
412412
before_create_trigger: set_dataset_status_new
413413
after_create_trigger: set_status_history
414414
after_update_trigger: update_status

src/schema/schema_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,12 +1441,12 @@ def normalize_entity_type(entity_type):
14411441
Parameters
14421442
----------
14431443
status : str
1444-
One of the status types: New|Processing|QA|Published|Error|Hold|Invalid
1444+
One of the status types: New|Processing|QA|Published|Error|Hold|Invalid|Approval
14451445
14461446
Returns
14471447
-------
14481448
string
1449-
One of the normalized status types: New|Processing|QA|Published|Error|Hold|Invalid
1449+
One of the normalized status types: New|Processing|QA|Published|Error|Hold|Invalid|Approval
14501450
"""
14511451
def normalize_status(status):
14521452
if status.lower() == "qa":

src/schema/schema_validators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ def validate_application_header_before_property_update(property_key, normalized_
414414
def validate_dataset_status_value(property_key, normalized_entity_type, request, existing_data_dict, new_data_dict):
415415
# Use lowercase for comparison
416416
accepted_status_values = [
417-
'new', 'processing', 'published', 'qa', 'error', 'hold', 'invalid', 'submitted', 'incomplete'
417+
'new', 'processing', 'published', 'qa', 'error', 'hold', 'invalid', 'submitted', 'incomplete', 'approval'
418418
]
419419
new_status = new_data_dict[property_key].lower()
420420

src/schema_templating/example-yaml-templates/api-template-test/entity-Template.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,8 @@ x-ref-components:
600600
- Error
601601
- Hold
602602
- Invalid
603-
description: "One of: New|Processing|QA|Published|Error|Hold|Invalid"
603+
- Approval
604+
description: "One of: New|Processing|QA|Published|Error|Hold|Invalid|Approval"
604605
title:
605606
type: string
606607
description: "The dataset title."

src/schema_templating/example-yaml-templates/dataset-schema.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ Dataset:
9191
- Error
9292
- Hold
9393
- Invalid
94-
description: "One of: New|Processing|QA|Published|Error|Hold|Invalid"
94+
- Approval
95+
description: "One of: New|Processing|QA|Published|Error|Hold|Invalid|Approval"
9596
title:
9697
type: string
9798
description: "The dataset title."

src/schema_templating/example-yaml-templates/entity-api-spec-TEMPLATE.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,8 @@ components:
579579
- Error
580580
- Hold
581581
- Invalid
582-
description: "One of: New|Processing|QA|Published|Error|Hold|Invalid"
582+
- Approval
583+
description: "One of: New|Processing|QA|Published|Error|Hold|Invalid|Approval"
583584
title:
584585
type: string
585586
description: "The dataset title."

0 commit comments

Comments
 (0)