跟随终端演示:
cd examples/tutorial
python 05_schedules.py
from datetime import timedelta, datetime
from prefect.schedules import IntervalSchedule
# ... task definitions ...
schedule = IntervalSchedule(
start_date=datetime.utcnow() + timedelta(seconds=1),
interval=timedelta(minutes=1),
)
with Flow("Aircraft-ETL", schedule=schedule) as flow:
airport = Parameter("airport", default="IAD")
radius = Parameter("radius", default=200)
reference_data = extract_reference_data()
live_data = extract_live_data(airport, radius, reference_data)
transformed_live_data = transform(live_data, reference_data)
load_reference_data(reference_data)
load_live_data(transformed_live_data)
Schedules附加信息。
有多种方法可以配置调度计划以满足各种需求。有关Schedules的更多信息,请参见后续文档。