Skip to content

Instantly share code, notes, and snippets.

@anna-geller
Created January 29, 2023 23:09
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 anna-geller/386426dca62cc33eea7c2934a9b8e570 to your computer and use it in GitHub Desktop.
Save anna-geller/386426dca62cc33eea7c2934a9b8e570 to your computer and use it in GitHub Desktop.
from prefect import task, flow
from prefect import get_run_logger
from typing import Any
@task
def say_hi(user_name: str, question: str, answer: Any) -> None:
logger = get_run_logger()
logger.info("Hello from Prefect, %s! 👋", user_name)
logger.info("The answer to the %s question is %s! 🤖", question, answer)
@flow
def parametrized(
user: str = "Marvin", question: str = "Ultimate", answer: Any = 42
) -> None:
say_hi(user, question, answer)
if __name__ == "__main__":
parametrized(user="World")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment