DatabricksRunNowOperator

Use the DatabricksRunNowOperator to trigger a run of an existing Databricks job via api/2.1/jobs/run-now API endpoint.

Using the Operator

There are two ways to instantiate this operator. In the first way, you can take the JSON payload that you typically use to call the api/2.1/jobs/run-now endpoint and pass it directly to our DatabricksRunNowOperator through the json parameter.

Another way to accomplish the same thing is to use the named parameters of the DatabricksRunNowOperator directly. Note that there is exactly one named parameter for each top level parameter in the jobs/run-now endpoint.

The only required parameters are either:

  • job_id - to specify ID of the existing Databricks job

  • job_name - Name of the existing Databricks job. It will throw exception if job isn’t found, of if there are multiple jobs with the same name.

All other parameters are optional and described in documentation for DatabricksRunNowOperator. For example, you can pass additional parameters to a job using one of the following parameters, depending on the type of tasks in the job:

  • notebook_params

  • python_params

  • python_named_parameters

  • jar_params

  • spark_submit_params

DatabricksRunNowDeferrableOperator

Deferrable version of the DatabricksRunNowOperator operator.

It allows to utilize Airflow workers more effectively using new functionality introduced in Airflow 2.2.0

Was this entry helpful?