Skip to content

Instantly share code, notes, and snippets.

@alexeygrigorev
Created June 14, 2022 09:27
Show Gist options
  • Save alexeygrigorev/562fc49fcb0f6e75f3770804172ddc50 to your computer and use it in GitHub Desktop.
Save alexeygrigorev/562fc49fcb0f6e75f3770804172ddc50 to your computer and use it in GitHub Desktop.
Prefect test
from datetime import datetime
from prefect import task, flow
from prefect import get_run_logger
@task
def hello_task(date):
logger = get_run_logger()
logger.info("INFO level log message.")
logger.info(f'date={date}')
return date
@flow
def hello_flow(date):
logger = get_run_logger()
result = hello_task(date)
logger.info(f'result={result}')
hello_flow(datetime.now())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment