Luis Gallegos
03/18/2021, 4:38 PMimport prefect
import pendulum
cron_now = pendulum.now()
str_date = cron_now.strftime('%Y%m%d_%H%M%S')
custom_schedule = CronSchedule("0 9 * * 0", start_date=cron_now)
def slack(text):
data = '{"channel":"XXX","text":"%s: %s"}' % (str_date, text)
@task
def task():
## do something
##call_slack
slack("Hello")
with Flow("fact_czenk", schedule=custom_schedule) as flow:
task = task()
flow.register()
Samuel Hinton
03/18/2021, 4:41 PMLuis Gallegos
03/18/2021, 4:42 PMLuis Gallegos
03/18/2021, 4:53 PMSamuel Hinton
03/18/2021, 4:54 PM