Prefect-meemoo Index / Prefect Meemoo / Config / Last Run
Auto-generated documentation for prefect_meemoo.config.last_run module.
def add_last_run_with_context(context: str, time: pendulum.DateTime = None): ...
Get the last run config for a flow.
If the flow is run with the parameter full_sync
and it is True, the last run config is ignored.
format
str - format of the returned timestamp
The datetime of the last run config or None if no last run config is found.
Configure a flow to get the last run config:
@flow(name="prefect_flow_test", on_completion=[save_last_run_config])
def main_flow(
full_sync: bool = True,
):
logger = get_run_logger()
logger.info("test")
logger.info(get_last_run_config())
def get_last_run_config(format="%Y-%m-%dT%H:%M:%S.%fZ", context: str = ""): ...
Save the last run config for a flow.
Result: The last run config is saved in a block in the prefect server. The name of the block is the name of the deployment + "-lastmodified".
Configure a flow to save the last run config:
@flow(name="prefect_flow_test", on_completion=[save_last_run_config])
def main_flow(
full_sync: bool = False,
):
logger = get_run_logger()
logger.info("test")
logger.info(get_last_run_config())
def save_last_run_config(flow: Flow, flow_run: FlowRun, state): ...