stikkireddy commented on code in PR #32221: URL: https://github.com/apache/airflow/pull/32221#discussion_r1294511481
########## docs/apache-airflow-providers-databricks/operators/jobs_create.rst: ########## @@ -0,0 +1,91 @@ + .. Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + .. http://www.apache.org/licenses/LICENSE-2.0 + + .. Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + + + +DatabricksJobsCreateOperator +============================ + +Use the :class:`~airflow.providers.databricks.operators.DatabricksJobsCreateOperator` to create +(or reset) a Databricks job. This operator relies on past XComs to remember the ``job_id`` that +was created so that repeated calls with this operator will update the existing job rather than +creating new ones. When paired with the DatabricksRunNowOperator all runs will fall under the same +job within the Databricks UI. + + +Using the Operator +------------------ + +There are three 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/create`` endpoint and pass it directly to our ``DatabricksJobsCreateOperator`` through the +``json`` parameter. With this approach you get full control over the underlying payload to Jobs REST API, including +execution of Databricks jobs with multiple tasks, but it's harder to detect errors because of the lack of the type checking. + +The second way to accomplish the same thing is to use the named parameters of the ``DatabricksJobsCreateOperator`` directly. Note that there is exactly +one named parameter for each top level parameter in the ``api/2.1/jobs/create`` endpoint. + +The third way is to use both the json parameter **AND** the named parameters. 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 ``DatabricksJobsCreateOperator`` supports are: + - ``name`` + - ``tags`` + - ``tasks`` + - ``job_clusters`` + - ``email_notifications`` + - ``webhook_notifications`` + - ``timeout_seconds`` + - ``schedule`` + - ``max_concurrent_runs`` + - ``git_source`` + - ``access_control_list`` Review Comment: resolved -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
