Avoid passing None
to arguments of prepare_shell_job_inputs
#351
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.
Originally noted in #348, and fixes #348.
The reason for the bug was that in this line:
aiida-workgraph/aiida_workgraph/engine/utils.py
Line 139 in 8f6260b
iteration was done over all input arguments of the
prepare_shell_job_inputs
function, usingNone
as the default for the ones that weren't contained in theinputs
dictionary passed to theprepare_for_shell_task
function of WorkGraph. This would lead toNone
values being passed explicitly to the arguments ofprepare_shell_job_inputs
, in particularresolve_command
, effectively overriding its defaultTrue
value.Inside
aiida-shell
the check for the absolute path of the executable inside theprepare_code
function (see here) would thus be skipped, and the WorkGraph would just fail silently at a later stage. With this PR, only the input arguments that are also contained in theinputs
of theprepare_for_shell_task
are being explicitly passed, while the rest is left unset.