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

Miniwdl fails on list with optional outputs even though select_all is used #614

Closed
rhpvorderman opened this issue Nov 9, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@rhpvorderman
Copy link
Contributor

See #613 that contains a minimum reproducible example.

@mlin
Copy link
Collaborator

mlin commented Nov 9, 2022

Thanks @rhpvorderman, quickly I was able to trace the root cause to a hacky workaround mentioned here, which has come back to bite me. I probably want to replace the hack with some proper solution, but need to think about what that will be.

miniwdl/WDL/runtime/task.py

Lines 665 to 667 in 0dc9a21

# We may overwrite File.value with None, which is an invalid state, then we'll fix it
# up (or abort) below. This trickery is because we don't, at this point, know whether
# the -declared- output type is optional.

@mlin mlin added the bug Something isn't working label Nov 9, 2022
@rhpvorderman
Copy link
Contributor Author

Yeah, this will result in a Array[File] with a None inside because the coercion to None is done after the select_all. At least that is how I understand the code.

It can be easily fixed by a hacky workaround elsewhere (if v.value is None return os.devnull) but that would make the codebase such a mess 😅 .

@rhpvorderman rhpvorderman changed the title Miniwdl files on list with optional outputs even though select_all is used Miniwdl fails on list with optional outputs even though select_all is used Nov 9, 2022
@mlin
Copy link
Collaborator

mlin commented Nov 18, 2022

I have a fix in #615, I think it's the right approach but still needs a bit of polishing.

@rhpvorderman
Copy link
Contributor Author

Nice! I currently have other priorities I need to attent to, but as soon as I have the time I will try out the branch on our WDL codebase.

mlin added a commit that referenced this issue Nov 22, 2022
Replace a hack in the postprocessing of File?/Directory? outputs, which was buggy (#614), related to when & how a nonexistent output path is changed to None.
@mlin mlin closed this as completed Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants