Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Aggregate API responses always contain empty dict for available_pipelines #348

Closed
1 task done
alyssadai opened this issue Oct 9, 2024 · 1 comment · Fixed by #349
Closed
1 task done
Assignees
Labels
released This issue/pull request has been released. type:bug Defects in shipped code and fixes for those defects

Comments

@alyssadai
Copy link
Contributor

alyssadai commented Oct 9, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Expected Behavior

When subject data in the graph contains pipeline metadata, an aggregate mode query response for the dataset should include a non-empty dictionary for available_pipelines.

Current Behavior

available_pipelines is always an empty dictionary {}.

This is because the aggregation statement in the SPARQL query template has not yet been updated to return pipeline variables, and similarly, the API-side handling of the graph response for an aggregate query currently does not consider these variables.

api/app/api/utility.py

Lines 306 to 315 in c150b37

if return_agg:
query_string = (
textwrap.dedent(
"""
SELECT ?dataset_uuid ?dataset_name ?dataset_portal_uri ?sub_id ?image_modal
WHERE {"""
)
+ textwrap.indent(query_string, " ")
+ "} GROUP BY ?dataset_uuid ?dataset_name ?dataset_portal_uri ?sub_id ?image_modal"
)

At the same time, the value of available_pipelines is always initialized as an empty dict:

dataset_available_pipeline_info = {}

available_pipelines=dataset_available_pipeline_info,

And so this is what is currently always returned in aggregate mode.

Error message

No response

Environment

  • OS:
  • Python/Node version:

How to reproduce

Install and launch the API from source, in aggregate mode, and point it to a graph containing data from fhttps://github.com/neurobagel/neurobagel_examples/tree/main/data-upload/pheno-bids-derivatives-output.

Anything else?

No response

@alyssadai alyssadai added the type:bug Defects in shipped code and fixes for those defects label Oct 9, 2024
@alyssadai alyssadai moved this to Implement - Active in Neurobagel Oct 9, 2024
@alyssadai alyssadai self-assigned this Oct 9, 2024
@alyssadai alyssadai changed the title [BUG] Aggregate API responses do not contain any pipeline data [BUG] Aggregate API responses always contain empty dict for completed_pipelines Oct 10, 2024
@alyssadai alyssadai moved this from Implement - Active to Implement - Done in Neurobagel Oct 10, 2024
@alyssadai alyssadai changed the title [BUG] Aggregate API responses always contain empty dict for completed_pipelines [BUG] Aggregate API responses always contain empty dict for available_pipelines Oct 10, 2024
@github-project-automation github-project-automation bot moved this from Review - Active to Review - Done in Neurobagel Oct 10, 2024
Copy link
Contributor

🚀 Issue was released in v0.4.0 🚀

@neurobagel-bot neurobagel-bot bot added the released This issue/pull request has been released. label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released. type:bug Defects in shipped code and fixes for those defects
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant