Open Molanda opened 2 years ago
Hey @Molanda :wave:, Thank you for opening an issue. We will get back to you as soon as we can. Also, check out our Open Collective and consider backing us - every little helps!
We also offer priority support for our sponsors. If you require immediate assistance please consider sponsoring us.
Checklist
Related Issues and Possible Duplicates
Related Issues
4562
Possible Duplicates
Brief Summary
The canvas documentation uses
add
andmul
task examples. Both these operations are commutative and are easy to implement.If instead, one were to use
sub
anddiv
, the canvas structure becomes more challenging. Here are the two tasks:Consider the following:
The first could be configured as
sub.s(7, 1) | div.s(2)
, but the remaining would require additional tasks:div_y_x(y, x)
anddiv_xy(xy)
However, tasks shouldn't be required to know how they will be used in the flow.
Design
To work around this, I created my own custom task class along with a helper class.
I'm not suggesting this should be the final solution, but wanted to use this to illustrate one idea.
With this configuration, the tasks signatures specify the keyword arguments and either provide a value or link to a specific result from the previous step.
Here are the three examples...
Architectural Considerations
None
Proposed Behavior
To avoid compatibility issues, this should probably require a flag on the task or app (
require_kwargs
) or different signature functions (keyword_signature
/ks
).I would also expect the final solution would be better integrated into the canvas.
My workaround uses special values that I don't expect from the tasks I have setup. It would be better to store the keyword argument to result linkage in some request meta-data and have this unwrapped before the type checking.
Proposed UI/UX
Diagrams
N/A
Alternatives
None