I’ve been using this structure until yesterday to create deployments:
deployment = Deployment.build_from_flow(
flow=workflows,
name=DEPLOYMENT,
skip_upload=True,
schedule = CronSchedule(cron="0 */4 * * *", timezone="Europe/Copenhagen")
)
if __name__ == "__main__":
deployment.apply()
Then yesterday I updated prefect to version 2.16.3 and the same flow gives the depreciated warning:
08:11:09.880 | WARNING | prefect.deployments - The field 'schedule' in 'Deployment' has been deprecated. It will not be available after Sep 2024. Define schedules in the `schedules` list instead.
The issues is that it does not create a deployment. Looking in the UI I see nothing is created.
How can I now create a CronSchedule for my deployment using the new method.