1. Learn
  2. /
  3. Courses
  4. /
  5. Databricks with the Python SDK

Connected

Exercise

Schedule a Databricks job

In this exercise, you will use the Databricks Workspace Client to create a job that runs a notebook with name HelloWorld at a scheduled time.

You already learned how to create a job that can be explicitly triggered. By passing in the schedule parameter to this function, you can schedule the job to run at a specific time by passing in a cron expression.

In this exercise, you can assume there is a predefined variable called cron_expression that represent the cron expression to run once a day at 3 am Eastern Time, respectively.

We have already created the WorkspaceClient(), storing as w, and a notebook_path variable.

Instructions

100 XP
  • Use the create() method in the WorkspaceClient.jobs API to create a job.
  • Schedule the job being created to run every day at 3 am in the eastern timezone, using the preset cron_expression variable.
  • Configure the job to time out after 25 seconds.