Skip to content

Instantly share code, notes, and snippets.

@chkoar
Last active February 19, 2022 19:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chkoar/09e9070a03a3d6d3a68b0dc3407cdd5c to your computer and use it in GitHub Desktop.
Save chkoar/09e9070a03a3d6d3a68b0dc3407cdd5c to your computer and use it in GitHub Desktop.
Target formatter for Prefect
from dask.base import tokenize
class TargetFormatter:
def __init__(self, *args):
self.args = args
def __call__(self, **kwargs):
args = self.args + ("task_name",)
ret = [kwargs.get(x) for x in args]
return tokenize(ret)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment