-
Notifications
You must be signed in to change notification settings - Fork 994
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
Allow to filter /api/invocations by job_id #11882
Allow to filter /api/invocations by job_id #11882
Conversation
lib/galaxy/managers/workflows.py
Outdated
if dataset_id is not None: | ||
invocations_query = invocations_query.join( | ||
model.WorkflowInvocationOutputDatasetAssociation | ||
).filter(model.WorkflowInvocationOutputDatasetAssociation.table.c.dataset_id == dataset_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only works for simple workflow outputs (so not for any random dataset produced by a workflow). It also doesn't work for collection. I think filtering by job is the correct way to do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, which is currently not yet possible right? So I could update this change from dataset_id
to job_id
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think that would be fine. There's a 1 to 1 relationship between job and invocation, so maybe this would be more appropriate in
def show_invocation(self, trans: GalaxyWebTransaction, invocation_id, **kwd): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, but then we need to make the invocation_id optional? Otherwise, one needs to know the invocation_id upfront..
However, the invocation_id
and potentially the workflow_id
could also be returned on the show job
endpoint, then there is no need for a filter.
I think this is quite similar to the API changes in #11244? |
@simonbray its similar indeed. Except that on the |
What did you do?
/api/invocations
to filter this endpoint by a dataset idWhy did you make this change?
This will allow one to retrieve the workflow invocation and subsequently the workflow (through the workflow id) that produced the given dataset.
Without this, I could only see to retrieve the responsible workflow through
/datasets/<id> -> creating_job -> /jobs/<id/ -> __workflow_invocation_uuid__ -> filter invocations/ -> (..)
Alternatively, I wanted to add the
workflow_id
to the dataset show endpoint, but due to the additional queries/joins this might be too heavy.In addition, I'm happy for alternative solutions to the problem "dataset_id => workflow_id".
How to test the changes?
/api/invocations?dataset_id=
License