From 7264f7ff3331406a7726ee70ff6aa94bf5ab1579 Mon Sep 17 00:00:00 2001 From: maxsibilla Date: Wed, 27 Mar 2024 16:16:37 -0400 Subject: [PATCH] Modifying dataset_is_primary to only return primary datasets where the creation action is 'create dataset activity' to prevent component datasets from appearing in the ingest board --- src/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app.py b/src/app.py index 97b76764..f7fae21a 100644 --- a/src/app.py +++ b/src/app.py @@ -2331,7 +2331,7 @@ def validate_donors(headers, records): # Determines if a dataset is Primary. If the list returned from the neo4j query is empty, the dataset is not primary def dataset_is_primary(dataset_uuid): with neo4j_driver_instance.session() as neo_session: - q = (f"MATCH (ds:Dataset {{uuid: '{dataset_uuid}'}})<-[:ACTIVITY_OUTPUT]-(a:Activity) WHERE NOT toLower(a.creation_action) ENDS WITH 'process' RETURN ds.uuid") + q = (f"MATCH (ds:Dataset {{uuid: '{dataset_uuid}'}})<-[:ACTIVITY_OUTPUT]-(a:Activity) WHERE toLower(a.creation_action) = 'create dataset activity' RETURN ds.uuid") result = neo_session.run(q).data() if len(result) == 0: return False