Skip to main content

prefect_state

Mapping from Prefect's StateType to this API's own RunState.

Module​

Functions​

map_state​

def map_state(    state_type: StateType | None,) ‑> RunState:

Return the RunState for state_type, or RunState.UNKNOWN if unmapped.

None (Prefect types a flow run's state_type as optional, though a real run always has one) is treated the same as any other unmapped value.

Arguments

  • state_type: The Prefect state type to translate.

Returns The mapped RunState.