From cbc661a3a34b0cb6049171a472a88a8cb92c9c85 Mon Sep 17 00:00:00 2001 From: zzstoatzz Date: Mon, 22 Jul 2024 17:43:07 -0500 Subject: [PATCH] use existing const NUM_CHARS_DYNAMIC_KEY --- src/prefect/tasks.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/prefect/tasks.py b/src/prefect/tasks.py index 0409a2a1624f..c5331d10149a 100644 --- a/src/prefect/tasks.py +++ b/src/prefect/tasks.py @@ -205,7 +205,9 @@ def _generate_task_key(fn: Callable) -> str: qualname = fn.__qualname__.split(".")[-1] - code_hash = h[:8] if (h := hash_objects(fn.__code__)) else "unknown" + code_hash = ( + h[:NUM_CHARS_DYNAMIC_KEY] if (h := hash_objects(fn.__code__)) else "unknown" + ) return f"{qualname}-{code_hash}"