Marwan Sarieddine
06/24/2020, 4:59 PMprefect.client.client.Client
- looking at the docs I see:
set_flow_run_state(
self, flow_run_id: str, version: int, state: "prefect.engine.state.State"
)
where I can pass the flow_run_id
and state
, but I am trying to understand the intuition behind setting version
Would I have to find the version of the task the flow is currently on and increment it ?version
referencing the task version or the flow version ? [if it is the flow version, why is that needed given I am passing the flow_run_id
) if it is the task version - why do I have to manually set it instead of prefect incrementing it for me ?Chris White
06/24/2020, 5:05 PMversion
is there for our “version locking” feature (which is currently only available on paid versions of Prefect Cloud), that ensures no tasks or flows are ever run twice. Basically it forces any client that ever attempts to update state to prove it is doing so with the latest state information (by providing the correct version number, otherwise an error is produced).
If you aren’t on a paid Cloud plan, then you can provide any integer there with no effect.Marwan Sarieddine
06/24/2020, 5:08 PMChris White
06/24/2020, 5:08 PMMarvin
06/24/2020, 5:09 PM