diff --git a/src/app.py b/src/app.py index 1b27618b..b609b5a6 100644 --- a/src/app.py +++ b/src/app.py @@ -2831,7 +2831,7 @@ def get_siblings(id): status = status.lower() if status not in SchemaConstants.ALLOWED_DATASET_STATUSES: abort_bad_req( - "Invalid Dataset Status. Must be 'new', 'qa', or 'published' Case-Insensitive" + "Invalid Dataset Status. Must be 'new', 'qa', 'approval' or 'published' Case-Insensitive" ) if property_key is not None: property_key = property_key.lower() @@ -4115,7 +4115,7 @@ def get_associated_sources_from_dataset(id): an sample that contain rui info will be returned. If false, only datasets that are NOT connected to samples containing rui info will be returned. By default, no filtering is performed. dataset_status : string - Filters results by dataset status. Accepted values are "Published", "QA", and "NEW". If a user only has access + Filters results by dataset status. Accepted values are "Published", "QA", "Approval" and "NEW". If a user only has access to published datasets and enters QA or New, an error will be raised. By default, no filtering is performed Returns @@ -4245,9 +4245,9 @@ def get_prov_info(): param_dict["has_rui_info"] = has_rui_info dataset_status = request.args.get("dataset_status") if dataset_status is not None: - if dataset_status.lower() not in ["new", "qa", "published"]: + if dataset_status.lower() not in ["new", "qa", "approval", "published"]: abort_bad_req( - "Invalid Dataset Status. Must be 'new', 'qa', or 'published' Case-Insensitive" + "Invalid Dataset Status. Must be 'new', 'qa', 'approval' or 'published' Case-Insensitive" ) if published_only and dataset_status.lower() != "published": abort_bad_req( diff --git a/src/requirements.dev.txt b/src/requirements.dev.txt index 5e231c69..3b9eb815 100644 --- a/src/requirements.dev.txt +++ b/src/requirements.dev.txt @@ -2,4 +2,4 @@ black>=26.3.1,<27.0 # For unit test -pytest>=7.4.4,<8.0 +pytest>=9.0.3,<10.0 \ No newline at end of file diff --git a/src/schema/provenance_schema.yaml b/src/schema/provenance_schema.yaml index 77fc8eac..a13bf895 100644 --- a/src/schema/provenance_schema.yaml +++ b/src/schema/provenance_schema.yaml @@ -538,7 +538,7 @@ ENTITIES: - validate_status_changed - validate_dataset_not_component generated: true - description: "One of: New|Processing|QA|Published|Error|Hold|Invalid|Incomplete" + description: "One of: New|Processing|QA|Approval|Published|Error|Hold|Invalid|Incomplete" before_create_trigger: set_dataset_status_new after_create_trigger: set_status_history after_update_trigger: update_status diff --git a/src/schema/schema_constants.py b/src/schema/schema_constants.py index 2009ead3..4e747877 100644 --- a/src/schema/schema_constants.py +++ b/src/schema/schema_constants.py @@ -31,6 +31,7 @@ class SchemaConstants(object): "processing", "published", "qa", + 'approval', "error", "hold", "invalid", diff --git a/src/schema/schema_manager.py b/src/schema/schema_manager.py index cb91856f..0c795a08 100644 --- a/src/schema/schema_manager.py +++ b/src/schema/schema_manager.py @@ -2001,7 +2001,7 @@ def normalize_status(status): Parameters ---------- status : str - One of the status types: New|Processing|QA|Published|Error|Hold|Invalid + One of the status types: New|Processing|QA|Approval|Published|Error|Hold|Invalid Returns ------- diff --git a/src/schema/schema_triggers.py b/src/schema/schema_triggers.py index 513f5c10..bab3bab5 100644 --- a/src/schema/schema_triggers.py +++ b/src/schema/schema_triggers.py @@ -4409,7 +4409,7 @@ def get_has_visualization( if user_token is None: valid_statuses = ["Published"] else: - valid_statuses = ["QA", "Published"] + valid_statuses = ["QA", "Approval", "Published"] _, dataset_category = get_dataset_category( property_key, @@ -4480,7 +4480,7 @@ def get_has_visualization( def get_has_qa_published_derived_dataset( property_key, normalized_type, user_token, existing_data_dict, new_data_dict ): - """Trigger event method that determines if a primary dataset a processed/derived dataset with a status of 'QA' and 'Published'. + """Trigger event method that determines if a primary dataset a processed/derived dataset with a status of 'QA'/'Approval' and 'Published'. Parameters ---------- @@ -4499,13 +4499,13 @@ def get_has_qa_published_derived_dataset( ------- Tuple[str, str] str: The target property key - str: Whether a primary dataset has at least one processed dataset with a status of 'QA', 'True' or 'False' + str: Whether a primary dataset has at least one processed dataset with a status of 'QA'/'Approval', 'True' or 'False' """ _, dataset_category = get_dataset_category( property_key, normalized_type, user_token, existing_data_dict, new_data_dict ) if equals(dataset_category, "primary"): - match_case = "AND s.status IN ['QA', 'Published']" + match_case = "AND s.status IN ['QA', 'Approval', 'Published']" descendants = schema_neo4j_queries.get_dataset_direct_descendants( schema_manager.get_neo4j_driver_instance(), existing_data_dict["uuid"], diff --git a/src/schema_templating/example-yaml-templates/api-template-test/entity-Template.yaml b/src/schema_templating/example-yaml-templates/api-template-test/entity-Template.yaml index fd1c7cdb..6dff3410 100644 --- a/src/schema_templating/example-yaml-templates/api-template-test/entity-Template.yaml +++ b/src/schema_templating/example-yaml-templates/api-template-test/entity-Template.yaml @@ -650,11 +650,12 @@ x-ref-components: - New - Processing - QA + - Approval - Published - Error - Hold - Invalid - description: "One of: New|Processing|QA|Published|Error|Hold|Invalid" + description: "One of: New|Processing|QA|Approval|Published|Error|Hold|Invalid" title: type: string description: "The dataset title." diff --git a/src/schema_templating/example-yaml-templates/dataset-schema.yaml b/src/schema_templating/example-yaml-templates/dataset-schema.yaml index ec11bcdb..73a1c747 100644 --- a/src/schema_templating/example-yaml-templates/dataset-schema.yaml +++ b/src/schema_templating/example-yaml-templates/dataset-schema.yaml @@ -87,11 +87,12 @@ Dataset: - New - Processing - QA + - Approval - Published - Error - Hold - Invalid - description: "One of: New|Processing|QA|Published|Error|Hold|Invalid" + description: "One of: New|Processing|QA|Approval|Published|Error|Hold|Invalid" title: type: string description: "The dataset title." diff --git a/src/schema_templating/example-yaml-templates/entity-api-spec-TEMPLATE.yaml b/src/schema_templating/example-yaml-templates/entity-api-spec-TEMPLATE.yaml index dd1cb899..7d4dd12f 100644 --- a/src/schema_templating/example-yaml-templates/entity-api-spec-TEMPLATE.yaml +++ b/src/schema_templating/example-yaml-templates/entity-api-spec-TEMPLATE.yaml @@ -575,11 +575,12 @@ components: - New - Processing - QA + - Approval - Published - Error - Hold - Invalid - description: "One of: New|Processing|QA|Published|Error|Hold|Invalid" + description: "One of: New|Processing|QA|Approval|Published|Error|Hold|Invalid" title: type: string description: "The dataset title."