pyinfra
pyinfra copied to clipboard
Make `python.call` operation idempotent-capable
Is your feature request related to a problem? Please describe
Currently python.call operation is not considered idempotent no matter what.
Describe the solution you'd like
Instead of the current behavior python.call operation can be modified to be shown as idempotent operation based on the return value of the function called with the following logic:
| Return value | Operation status |
|---|---|
None |
Success (current behavior) |
True |
Success |
False |
No changes |
This will enable to implement the idempotent logic in the function itself and correctly represent it in run report, while keeping the current behavior intact, when the function does not return anything.
This is an excellent idea 👍
I agree. Wouldn't an enum be a better choice though (wrapped in Optional[] to keep BC)?