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.
Parameter |
Input |
---|---|
job_id: str |
ID of the existing Databricks jobs (required if |
job_name: str |
Name of the existing Databricks job (required if |
jar_params: list[str] |
A list of parameters for jobs with JAR tasks, e.g. |
notebook_params: dict[str,str] |
A dict from keys to values for jobs with notebook task, e.g.``"notebook_params": {"name": "john doe", "age": "35"}```. The map is passed to the notebook and will be accessible through the |
python_params: list[str] |
A list of parameters for jobs with python tasks, e.g. |
spark_submit_params: list[str] |
A list of parameters for jobs with spark submit task, e.g. |
timeout_seconds: int |
The timeout for this run. By default a value of 0 is used which means to have no timeout. This field will be templated. |
databricks_conn_id: string |
the name of the Airflow connection to use |
polling_period_seconds: integer |
controls the rate which we poll for the result of this run |
databricks_retry_limit: integer |
amount of times retry if the Databricks backend is unreachable |
databricks_retry_delay: decimal |
number of seconds to wait between retries |
databricks_retry_args: dict |
An optional dictionary with arguments passed to |
do_xcom_push: boolean |
whether we should push run_id and run_page_url to xcom |