Skip to content

Commit

Permalink
use existing const NUM_CHARS_DYNAMIC_KEY
Browse files Browse the repository at this point in the history
  • Loading branch information
zzstoatzz committed Jul 22, 2024
1 parent a63c9bd commit cbc661a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/prefect/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down

0 comments on commit cbc661a

Please sign in to comment.