Skip to content

Commit

Permalink
Merge pull request #537 from hubmapconsortium/maxsibilla/data-status-…
Browse files Browse the repository at this point in the history
…primary

Modifying dataset_is_primary to only return primary datasets where th…
  • Loading branch information
yuanzhou authored Apr 1, 2024
2 parents 0b93181 + 7264f7f commit dfc3964
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2333,7 +2333,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
Expand Down

0 comments on commit dfc3964

Please sign in to comment.