-
Notifications
You must be signed in to change notification settings - Fork 659
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
Nullable input/output paths #2893
Nullable input/output paths #2893
Conversation
modules/nextflow/src/main/groovy/nextflow/util/NullablePath.groovy
Outdated
Show resolved
Hide resolved
In the end, I think I've found the way to run all tests although it's a little tricky and probably we need to investigate deeper Don't know why/where if we run in the same So to solve this situation I exclude InputNullable and OutputNullable from the tests and run them in an isolated test |
Why do we prefer nullable versus optional? The latter could have type Option. Which is more idiomatic of something that is optional? Also, nullable is less intuitive to folks who don’t know what null means. |
The rationale was described at point 3 here. To summarise we are using already This is quite different from emitting a value with a |
Are we calling it |
I agree, |
ae6f219
to
b121fac
Compare
519907b
to
a23d0b6
Compare
We need to improve the e2e pipeline tests, ideally we should have one process emit a nullable path to another process, and it succeeds or fails based on whether or not the nullable paths are specified correctly. Also, the original motivation for this feature was a tuple that contains a path. I wonder what happens if a process emits a nullable path by itself. I guess it's just a null value? |
65b2906
to
904c940
Compare
|
@jorgeaguileraseqera This was not supported to be merged. Above all it looks like you force-pushed your branch overriding the changes in this PR. Do you have a local copy? |
Yes, I have it I'm reviewing it and trying to reopen the PR. Sorry for inconveniences |
closes #2678 Signed-off-by: Jorge Aguilera <jorge.aguilera@seqera.io>
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
@pditommaso I cleaned up this PR and updated the e2e tests. Also fixed a bug with the nullable input path. I think this PR is ready to go. Here's the output of the main e2e test, in which process foo emits a nullable path and process bar accepts it: $ ./launch.sh tests/nullable-path-succeeds.nf
N E X T F L O W ~ version 23.02.0-edge
Launching `tests/nullable-path-succeeds.nf` [naughty_fermi] DSL2 - revision: 41393792fb
executor > local (2)
[de/f4993a] process > foo (1) [100%] 1 of 1 ✔
[51/badde8] process > bar (1) [100%] 1 of 1 ✔
foo
output.txt
output.txt
WARN: File system is unable to get file attributes file: nextflow.util.NullPath@7f -- Cause: java.nio.file.ProviderMismatchException It works but maybe we should figure out how to suppress the file attributes warning? |
In case the unit tests don't run, I confirmed that they pass locally: $ make smoke
NXF_SMOKE=1 ./gradlew test
BUILD SUCCESSFUL in 3m 14s
91 actionable tasks: 39 executed, 52 up-to-date |
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
While I understand the difference between optional and nullable, I'm wondering if we shouldn't just extend
The only thing you lose that way is making a standalone path nullable vs optional, but I don't think that is needed. |
I agree trying to not overload the declaration with new keyword, but what about point 3 here (I copy it below for your convenience):
|
I would avoid that issue by having the nullable behavior only apply to nested params in a tuple, that way there is no distinction between However, your comment here makes me think there is a case for standalone paths to be nullable. So now I am leaning back towards having a separate |
0d59b4c
to
b93634e
Compare
Hi there - is there any update on whether this will be merged into the main branch and released with the next version of nextflow? I have a use case in my current pipeline that would really benefit from this (specifically, using the remainder:true option when joining two channels that I pass onto a subsequent process). |
I do need to fix the merge conflict, but otherwise it's just waiting for @pditommaso 's approval. |
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
Closing in favor of #3706 |
new feature to allow nonexisting paths in input and output parameters
closes #2678
p.d.
it has 2 tests ignored in
ScriptDslTest
because with themScriptRunnerTest
fails by Timeout but don't know why