Hi! Whenever I rerun a flow, it reuses values from the previous run for the parameters declared globally. How should I handle this?
#!/usr/bin/python3
from datetime import datetime
from prefect import task, Flow, Parameter, context, case
from prefect.utilities.debug import is_serializable
logger = context.get("logger")
timestamp = datetime.now().strftime("%Y-%m-%dT%H-%M-%S")
@task
def print_timestamp():
<http://logger.info|logger.info>(timestamp)
with Flow("Test") as flow:
print_timestamp()
serializable = is_serializable(flow)
if serializable:
flow.register(project_name="Default",
idempotency_key=flow.serialized_hash())
flow.run()
Attached screenshot from two runs. As you could see, the value of the global parameter
timestamp
hasn't changed