I am trying to use `idempotency_key=flow.serialize...
# ask-community
p
I am trying to use
idempotency_key=flow.serialized_hash()
when registering a flow. The hash is changing even when nothing has changed in the flow. Any ideas?
I am running 0.13.15. I am using this script:
Copy code
import prefect
from prefect import task, Flow
from prefect.environments.storage import Docker


@task
def hello_task():
    logger = prefect.context.get("logger")
    <http://logger.info|logger.info>("Hello, Docker!")


flow = Flow("hello-docker", tasks=[hello_task])

flow.storage = Docker()

idempotency_key = flow.serialized_hash()
print(idempotency_key)
flow.register(project_name="myproject", idempotency_key=idempotency_key)
Every time I run this I get different results
n
Hi @Pedro Machado - thanks for brining this up; this is a known bug (there's a PR open to fix it); we expect it to go out with the next release. In the meantime you can provide an explicit
idempotency_key
to prevent subsequent registrations when you know changes haven't been made.
👍 2