-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
KeyError thrown when switch tasks are invoked in dry-run mode #115
Comments
Hi @fdaguin, thanks for the feedback! Nice to see someone using the new feature already. This is an interesting problem actually... what exactly should happen when running a switch task as a dry run? Normally dry run means no tasks are actually executed, but if the control task is not executed then we can't know which case would be executed... My feeling is that the in this case we should make an exception and execute the control task, with the assumption that it isn't meant to have any side effects. Alternatively it could result in something like: Poe <= check_number[control]
Poe => <unresolved case> What do you think? |
Thanks a lot for this neat feature! ✌️ As for your suggestions, both points are completely valid and I'm also in favor for the control task being executed. What about a boolean option like |
…#115 Since it's not possible to properly resolve the content of these tasks without actually executing the tasks they depend on, instead of outputting the task content we print a message that it is unresolved.
This issue is fixed in v0.18.1. I went with not running the control task in the end because I figured running any tasks in dry-mode could be surprising, and for consistency with handling the similar issue with tasks that define the "uses" option to depend on the output of other tasks. |
Thanks @nat-n! |
Expected Behavior
When invoking a task of type
switch
in--dry-run
mode, no error is thrown.Actual Behavior
A
KeyError: ('task_name[control]',)
is thrown.Steps to Reproduce the Problem
BEST_NUMBER=12 poe check_number
and expect no error:BEST_NUMBER=12 poe --dry-run check_number
and expect an error:Specifications
The text was updated successfully, but these errors were encountered: