Skip to content

Instantly share code, notes, and snippets.

@zzstoatzz
Last active May 23, 2022 20:31
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 zzstoatzz/b4b02251db42481c8399f11725506670 to your computer and use it in GitHub Desktop.
Save zzstoatzz/b4b02251db42481c8399f11725506670 to your computer and use it in GitHub Desktop.
from prefect.tasks import task_input_hash
@task(cache_key_fn=task_input_hash)
def get_games(url: str) -> List[Game]:
logger = get_run_logger()
logger.info(f"GET {url}")
return [Game(game['pgn'])for game in requests.get(url).json()['games']]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment