class_docstr: Runs an existing Spark job run to Databricks using the api/2.1/jobs/run-now API endpoint.
  
  See: https://docs.databricks.com/dev-tools/api/latest/jobs.html#operation/JobsRunNow
  
  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.
  For example ::
  
      json = {
          "job_id": 42,
          "notebook_params": {"dry-run": "true", "oldest-time-to-consider": "1457570074236"},
      }
  
      notebook_run = DatabricksRunNowOperator(task_id="notebook_run", json=json)
  
  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 ``run-now``
  endpoint. In this method, your code would look like this: ::
  
      job_id = 42
  
      notebook_params = {"dry-run": "true", "oldest-time-to-consider": "1457570074236"}
  
      python_params = ["douglas adams", "42"]
  
      jar_params = ["douglas adams", "42"]
  
      spark_submit_params = ["--class", "org.apache.spark.examples.SparkPi"]
  
      notebook_run = DatabricksRunNowOperator(
          job_id=job_id,
          notebook_params=notebook_params,
          python_params=python_params,
          jar_params=jar_params,
          spark_submit_params=spark_submit_params,
      )
  
  In the case where both the json parameter **AND** the named parameters
  are provided, they will be merged together. If there are conflicts during the merge,
  the named parameters will take precedence and override the top level ``json`` keys.
  
  Currently the named parameters that ``DatabricksRunNowOperator`` supports are
      - ``job_id``
      - ``job_name``
      - ``json``
      - ``notebook_params``
      - ``python_params``
      - ``python_named_parameters``
      - ``jar_params``
      - ``spark_submit_params``
      - ``idempotency_token``
      - ``repair_run``
  
  :param job_id: the job_id of the existing Databricks job.
      This field will be templated.
  
      .. seealso::
          https://docs.databricks.com/dev-tools/api/latest/jobs.html#operation/JobsRunNow
  :param job_name: the 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.
  :param json: A 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)
  
      .. seealso::
          For more information about templating see :ref:`concepts:jinja-templating`.
          https://docs.databricks.com/dev-tools/api/latest/jobs.html#operation/JobsRunNow
  :param notebook_params: 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
      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.
  
      .. seealso::
          https://docs.databricks.com/user-guide/notebooks/widgets.html
  :param python_params: A 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.
  
      .. seealso::
          https://docs.databricks.com/dev-tools/api/latest/jobs.html#operation/JobsRunNow
  :param python_named_params: A 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.
  
      .. seealso::
          https://docs.databricks.com/dev-tools/api/latest/jobs.html#operation/JobsRunNow
  :param jar_params: A 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.
  
      .. seealso::
          https://docs.databricks.com/dev-tools/api/latest/jobs.html#operation/JobsRunNow
  :param spark_submit_params: A 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.
  
      .. seealso::
          https://docs.databricks.com/dev-tools/api/latest/jobs.html#operation/JobsRunNow
  :param idempotency_token: an 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.
  :param databricks_conn_id: Reference to the :ref:`Databricks connection <howto/connection:databricks>`.
      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)
  :param polling_period_seconds: Controls the rate which we poll for the result of
      this run. By default, the operator will poll every 30 seconds.
  :param databricks_retry_limit: Amount of times retry if the Databricks backend is
      unreachable. Its value must be greater than or equal to 1.
  :param databricks_retry_delay: Number of seconds to wait between retries (it
          might be a floating point number).
  :param databricks_retry_args: An optional dictionary with arguments passed to ``tenacity.Retrying`` class.
  :param do_xcom_push: Whether we should push run_id and run_page_url to xcom.
  :param wait_for_termination: if we should wait for termination of the job run. ``True`` by default.
  :param deferrable: Run operator in the deferrable mode.
  :param repair_run: Repair the databricks run in case of failure, doesn't work in deferrable mode
class_docstr_tok: ["Runs","an","existing","Spark","job","run","to","Databricks","using","the","api\/2.1\/jobs\/run-now","API","endpoint",".","See",":","https",":","\/\/docs.databricks.com\/dev-tools\/api\/latest\/jobs.html","#","operation\/JobsRunNow","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",".","For","example",":",":","json","=","{","``","job_id","''",":","42",",","``","notebook_params","''",":","{","``","dry-run","''",":","``","true","''",",","``","oldest-time-to-consider","''",":","``","1457570074236","''","}",",","}","notebook_run","=","DatabricksRunNowOperator","(","task_id=","''","notebook_run","''",",","json=json",")","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","``","run-now","``","endpoint",".","In","this","method",",","your","code","would","look","like","this",":",":",":","job_id","=","42","notebook_params","=","{","``","dry-run","''",":","``","true","''",",","``","oldest-time-to-consider","''",":","``","1457570074236","''","}","python_params","=","[","``","douglas","adams","''",",","``","42","''","]","jar_params","=","[","``","douglas","adams","''",",","``","42","''","]","spark_submit_params","=","[","``","--","class","''",",","``","org.apache.spark.examples.SparkPi","''","]","notebook_run","=","DatabricksRunNowOperator","(","job_id=job_id",",","notebook_params=notebook_params",",","python_params=python_params",",","jar_params=jar_params",",","spark_submit_params=spark_submit_params",",",")","In","the","case","where","both","the","json","parameter","*","*","AND","*","*","the","named","parameters","are","provided",",","they","will","be","merged","together",".","If","there","are","conflicts","during","the","merge",",","the","named","parameters","will","take","precedence","and","override","the","top","level","``","json","``","keys",".","Currently","the","named","parameters","that","``","DatabricksRunNowOperator","``","supports","are","-","``","job_id","``","-","``","job_name","``","-","``","json","``","-","``","notebook_params","``","-","``","python_params","``","-","``","python_named_parameters","``","-","``","jar_params","``","-","``","spark_submit_params","``","-","``","idempotency_token","``","-","``","repair_run","``",":","param","job_id",":","the","job_id","of","the","existing","Databricks","job",".","This","field","will","be","templated",".","..","seealso",":",":","https",":","\/\/docs.databricks.com\/dev-tools\/api\/latest\/jobs.html","#","operation\/JobsRunNow",":","param","job_name",":","the","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",".",":","param","json",":","A","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",")","..","seealso",":",":","For","more","information","about","templating","see",":","ref",":","`","concepts",":","jinja-templating","`",".","https",":","\/\/docs.databricks.com\/dev-tools\/api\/latest\/jobs.html","#","operation\/JobsRunNow",":","param","notebook_params",":","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","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","can","not","be","specified","in","conjunction","with","jar_params",".","The","json","representation","of","this","field","(","i.e",".","{","``","notebook_params","''",":","{","``","name","''",":","''","john","doe","''",",","''","age","''",":","''","35","''","}","}",")","can","not","exceed","10,000","bytes",".","This","field","will","be","templated",".","..","seealso",":",":","https",":","\/\/docs.databricks.com\/user-guide\/notebooks\/widgets.html",":","param","python_params",":","A","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","''","]","}",")","can","not","exceed","10,000","bytes",".","This","field","will","be","templated",".","..","seealso",":",":","https",":","\/\/docs.databricks.com\/dev-tools\/api\/latest\/jobs.html","#","operation\/JobsRunNow",":","param","python_named_params",":","A","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",".","..","seealso",":",":","https",":","\/\/docs.databricks.com\/dev-tools\/api\/latest\/jobs.html","#","operation\/JobsRunNow",":","param","jar_params",":","A","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","''","]","}",")","can","not","exceed","10,000","bytes",".","This","field","will","be","templated",".","..","seealso",":",":","https",":","\/\/docs.databricks.com\/dev-tools\/api\/latest\/jobs.html","#","operation\/JobsRunNow",":","param","spark_submit_params",":","A","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","can","not","exceed","10,000","bytes",".","This","field","will","be","templated",".","..","seealso",":",":","https",":","\/\/docs.databricks.com\/dev-tools\/api\/latest\/jobs.html","#","operation\/JobsRunNow",":","param","idempotency_token",":","an","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",".",":","param","databricks_conn_id",":","Reference","to","the",":","ref",":","`","Databricks","connection","<","howto\/connection",":","databricks",">","`",".","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",")",":","param","polling_period_seconds",":","Controls","the","rate","which","we","poll","for","the","result","of","this","run",".","By","default",",","the","operator","will","poll","every","30","seconds",".",":","param","databricks_retry_limit",":","Amount","of","times","retry","if","the","Databricks","backend","is","unreachable",".","Its","value","must","be","greater","than","or","equal","to","1.",":","param","databricks_retry_delay",":","Number","of","seconds","to","wait","between","retries","(","it","might","be","a","floating","point","number",")",".",":","param","databricks_retry_args",":","An","optional","dictionary","with","arguments","passed","to","``","tenacity.Retrying","``","class",".",":","param","do_xcom_push",":","Whether","we","should","push","run_id","and","run_page_url","to","xcom",".",":","param","wait_for_termination",":","if","we","should","wait","for","termination","of","the","job","run",".","``","True","``","by","default",".",":","param","deferrable",":","Run","operator","in","the","deferrable","mode",".",":","param","repair_run",":","Repair","the","databricks","run","in","case","of","failure",",","does","n't","work","in","deferrable","mode"]
code: def _get_hook(self, caller: str) -> DatabricksHook:
      return DatabricksHook(
          self.databricks_conn_id,
          retry_limit=self.databricks_retry_limit,
          retry_delay=self.databricks_retry_delay,
          retry_args=self.databricks_retry_args,
          caller=caller,
      )
  
imports: from __future__ import annotations
  import time
  import warnings
  from functools import cached_property
  from logging import Logger
  from typing import TYPE_CHECKING, Any, Sequence
  from airflow.configuration import conf
  from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
  from airflow.models import BaseOperator, BaseOperatorLink, XCom
  from airflow.providers.databricks.hooks.databricks import DatabricksHook, RunState
  from airflow.providers.databricks.triggers.databricks import DatabricksExecutionTrigger
  from airflow.providers.databricks.utils.databricks import normalise_json_content, validate_trigger_event
label_desc: Use image node_id 3 for calling the DatabricksRunNowOperator obj's underlying member method code with example usage: obj._get_hook(caller) and returns: DatabricksHook