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

Avoid passing None to arguments of prepare_shell_job_inputs #351

Merged
merged 2 commits into from
Nov 19, 2024

Conversation

GeigerJ2
Copy link
Contributor

Originally noted in #348, and fixes #348.

The reason for the bug was that in this line:

kwargs = {key: inputs.pop(key, None) for key in signature.parameters.keys()}

iteration was done over all input arguments of the prepare_shell_job_inputs function, using None as the default for the ones that weren't contained in the inputs dictionary passed to the prepare_for_shell_task function of WorkGraph. This would lead to None values being passed explicitly to the arguments of prepare_shell_job_inputs, in particular resolve_command, effectively overriding its default True value.

Inside aiida-shell the check for the absolute path of the executable inside the prepare_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 the inputs of the prepare_for_shell_task are being explicitly passed, while the rest is left unset.

Copy link
Member

@superstar54 superstar54 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Please merge if all tests pass.

@GeigerJ2 GeigerJ2 merged commit f03ff55 into aiidateam:main Nov 19, 2024
8 checks passed
@GeigerJ2 GeigerJ2 deleted the fix/348/shelljob-inputs-none branch November 19, 2024 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Capture ValueError from aiida-shell for non-existing executable
2 participants