DatabricksRunNowDeferrableOperator

Databricks

Deferrable version of DatabricksRunNowOperator

View on GitHub

Last Updated: Mar. 7, 2023

Access Instructions

Install the Databricks provider package into your Airflow environment.

Import the module into your DAG file and instantiate it with your desired params.

Parameters

job_idthe job_id of the existing Databricks job. This field will be templated. See also https://docs.databricks.com/dev-tools/api/latest/jobs.html#operation/JobsRunNow
job_namethe name of the existing Databricks job. It must exist only one job with the specified name. job_id and job_name are mutually exclusive. This field will be templated.
jsonA JSON object containing API parameters which will be passed directly to the api/2.1/jobs/run-now endpoint. The other named parameters (i.e. notebook_params, spark_submit_params..) to this operator will be merged with this json dictionary if they are provided. If there are conflicts during the merge, the named parameters will take precedence and override the top level json keys. (templated) See also For more information about templating see Jinja Templating. https://docs.databricks.com/dev-tools/api/latest/jobs.html#operation/JobsRunNow
notebook_paramsA 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 dbutils.widgets.get function. See Widgets for more information. If not specified upon run-now, the triggered run will use the job’s base parameters. notebook_params cannot be specified in conjunction with jar_params. The json representation of this field (i.e. {“notebook_params”:{“name”:”john doe”,”age”:”35”}}) cannot exceed 10,000 bytes. This field will be templated. See also https://docs.databricks.com/user-guide/notebooks/widgets.html
python_paramsA list of parameters for jobs with python tasks, e.g. “python_params”: [“john doe”, “35”]. The parameters will be passed to python file as command line parameters. If specified upon run-now, it would overwrite the parameters specified in job setting. The json representation of this field (i.e. {“python_params”:[“john doe”,”35”]}) cannot exceed 10,000 bytes. This field will be templated. See also https://docs.databricks.com/dev-tools/api/latest/jobs.html#operation/JobsRunNow
python_named_paramsA list of named parameters for jobs with python wheel tasks, e.g. “python_named_params”: {“name”: “john doe”, “age”: “35”}. If specified upon run-now, it would overwrite the parameters specified in job setting. This field will be templated. See also https://docs.databricks.com/dev-tools/api/latest/jobs.html#operation/JobsRunNow
jar_paramsA list of parameters for jobs with JAR tasks, e.g. “jar_params”: [“john doe”, “35”]. The parameters will be passed to JAR file as command line parameters. If specified upon run-now, it would overwrite the parameters specified in job setting. The json representation of this field (i.e. {“jar_params”:[“john doe”,”35”]}) cannot exceed 10,000 bytes. This field will be templated. See also https://docs.databricks.com/dev-tools/api/latest/jobs.html#operation/JobsRunNow
spark_submit_paramsA list of parameters for jobs with spark submit task, e.g. “spark_submit_params”: [”–class”, “org.apache.spark.examples.SparkPi”]. The parameters will be passed to spark-submit script as command line parameters. If specified upon run-now, it would overwrite the parameters specified in job setting. The json representation of this field cannot exceed 10,000 bytes. This field will be templated. See also https://docs.databricks.com/dev-tools/api/latest/jobs.html#operation/JobsRunNow
idempotency_tokenan optional token that can be used to guarantee the idempotency of job run requests. If a run with the provided token already exists, the request does not create a new run but returns the ID of the existing run instead. This token must have at most 64 characters.
databricks_conn_idReference to the Databricks connection. By default and in the common case this will be databricks_default. To use token based authentication, provide the key token in the extra field for the connection and create the key host and leave the host field empty. (templated)
polling_period_secondsControls the rate which we poll for the result of this run. By default, the operator will poll every 30 seconds.
databricks_retry_limitAmount of times retry if the Databricks backend is unreachable. Its value must be greater than or equal to 1.
databricks_retry_delayNumber of seconds to wait between retries (it might be a floating point number).
databricks_retry_argsAn optional dictionary with arguments passed to tenacity.Retrying class.
do_xcom_pushWhether we should push run_id and run_page_url to xcom.
wait_for_terminationif we should wait for termination of the job run. True by default.

Documentation

Deferrable version of DatabricksRunNowOperator

Was this page helpful?