Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3988,7 +3988,7 @@ def paired_dataset(id):
- type: str
- description: the uuid for the parent multi assay dataset
datasets
- type: dict
- type: list
- description: the datasets to be created. Only difference between these and normal datasets are the field "dataset_link_abs_dir"

Returns
Expand Down Expand Up @@ -4042,7 +4042,7 @@ def multiple_components():
bad_request_error(f"The dataset with uuid {direct_ancestor_uuid} already has component children dataset(s)")
# validate that there is at least one component dataset
if len(json_data_dict.get('datasets')) < 1:
bad_request_error(f"'datasets' field must contain at leawst 1 dataset.")
bad_request_error(f"'datasets' field must contain at least 1 dataset.")

# Validate all datasets using existing schema with triggers and validators
for dataset in json_data_dict.get('datasets'):
Expand Down
25 changes: 13 additions & 12 deletions src/schema/schema_triggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1658,18 +1658,19 @@ def sync_component_dataset_status(property_key, normalized_type, user_token, exi
if 'status' not in existing_data_dict:
raise KeyError("Missing 'status' key in 'existing_data_dict' during calling 'link_dataset_to_direct_ancestors()' trigger method.")
status = existing_data_dict['status']
children_uuids_list = schema_neo4j_queries.get_children(schema_manager.get_neo4j_driver_instance(), uuid, property_key='uuid')
status_body = {"status": status}
for child_uuid in children_uuids_list:
creation_action = schema_neo4j_queries.get_entity_creation_action_activity(schema_manager.get_neo4j_driver_instance(), child_uuid)
if creation_action == 'Multi-Assay Split':
url = schema_manager.get_entity_api_url() + SchemaConstants.ENTITY_API_UPDATE_ENDPOINT + '/' + child_uuid
request_headers = {
'Authorization': f'Bearer {user_token}'
}
request_headers[SchemaConstants.HUBMAP_APP_HEADER] = SchemaConstants.INGEST_API_APP
request_headers[SchemaConstants.INTERNAL_TRIGGER] = SchemaConstants.COMPONENT_DATASET
response = requests.put(url=url, headers=request_headers, json=status_body)
if status.lower() != "published":
children_uuids_list = schema_neo4j_queries.get_children(schema_manager.get_neo4j_driver_instance(), uuid, property_key='uuid')
status_body = {"status": status}
for child_uuid in children_uuids_list:
creation_action = schema_neo4j_queries.get_entity_creation_action_activity(schema_manager.get_neo4j_driver_instance(), child_uuid)
if creation_action == 'Multi-Assay Split':
url = schema_manager.get_entity_api_url() + SchemaConstants.ENTITY_API_UPDATE_ENDPOINT + '/' + child_uuid
request_headers = {
'Authorization': f'Bearer {user_token}'
}
request_headers[SchemaConstants.HUBMAP_APP_HEADER] = SchemaConstants.INGEST_API_APP
request_headers[SchemaConstants.INTERNAL_TRIGGER] = SchemaConstants.COMPONENT_DATASET
response = requests.put(url=url, headers=request_headers, json=status_body)


####################################################################################################
Expand Down