ENH: allow typing.Union in action outputs - #754
Closed
misialq wants to merge 1 commit into
Closed
Conversation
ebolyen
reviewed
Mar 4, 2024
| if isinstance(output_view, arg): | ||
| # we need a new spec with the correct view type | ||
| spec = ParameterSpec( | ||
| qiime_type=spec.qiime_type, view_type=arg, |
Contributor
There was a problem hiding this comment.
Having not looked very much into it, should this be something we handle in transform.py? It's a scary place, but it seems like where I would expect to deconstruct the union.
Contributor
Author
There was a problem hiding this comment.
Hey @ebolyen, I did have a look but tbh I wasn't sure how exactly to do it there... If you have any hints, let me know 🙏
Contributor
There was a problem hiding this comment.
Hey @ebolyen, resurfacing this thread - any thoughts on the above?
Collaborator
|
implemented in #961 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey @ebolyen, @lizgehret,
It's been bugging me for a while now that a single action cannot output artifacts of different semantic types if their output data type indicated on the function signature differs. For example, in the use case I recently posted on the forum I'd like to produce the following two kinds of outputs:
SampleData[BLAST6]->SeedOrthologDirFmtFeatureData[BLAST6]->BLAST6DirectoryFormatI cannot do that, since the two directory formats are different (and they are not easily "transformable"). I tried adapting the SDK to enable this by using a Union of output types (see below), similarly to how it was done for the input unions. Does this makes sense to you? If yes, I'd love to add some tests - it would be super-helpful if you could point me as to where they should live as I cannot really find a good spot 😅