John Mizerany
06/14/2024, 5:08 PMJohn Mizerany
06/14/2024, 5:18 PMprefect.flows.deploy
from the Python SDK, and I am passing in cron
for the schedule, but I assume that I also need to pass in schedule
to specify the timezone?Kevin Grismore
06/14/2024, 5:31 PMJohn Mizerany
06/14/2024, 5:32 PMschedules
to pass a timezone in using the SDK?John Mizerany
06/14/2024, 5:32 PMschedules Optional[List[MinimalDeploymentSchedule]] A list of schedule objects defining when to execute runs of this deployment. Used to define multiple schedules or additional scheduling options like timezone.
John Mizerany
06/14/2024, 5:33 PMKevin Grismore
06/14/2024, 5:34 PMfrom prefect import flow, get_run_logger
from prefect.client.schemas.schedules import CronSchedule
@flow
def parent():
get_run_logger().info("Starting parent flow")
if __name__ == "__main__":
parent.deploy(
schedules=[CronSchedule(cron="0 0 * * *", timezone="America/New_York")]
)
John Mizerany
06/14/2024, 5:34 PM