mik-laj commented on a change in pull request #20882: URL: https://github.com/apache/airflow/pull/20882#discussion_r818077329
########## File path: docs/apache-airflow-providers-google/operators/cloud/looker.rst ########## @@ -0,0 +1,71 @@ + .. 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. + +Google Cloud Looker Operators +=============================== + +Looker is a business intelligence software and big data analytics platform that +helps you explore, analyze and share real-time business analytics easily. + +Looker has a Public API and associated SDK clients in different languages, +which allow programmatic access to the Looker data platform. + +For more information visit `Looker API documentation <https://docs.looker.com/reference/api-and-integration>`_. + +Prerequisite Tasks +------------------ + +To use these operators, you must do a few things: + +* Install API libraries via **pip**. + +.. code-block:: bash + + pip install 'apache-airflow[google]' + +Detailed information is available for :doc:`Installation <apache-airflow:installation/index>`. + +* Setup a Looker connection in Airflow. You can check :doc:`apache-airflow:howto/connection` and :doc:`apache-airflow-providers-google:connections/gcp_looker` + +Start a PDT materialization job +------------------------------- + +To submit a PDT materialization job to Looker you need to provide a model and view name. + +The job configuration can be submitted in synchronous (blocking) mode by using: +:class:`~airflow.providers.google.cloud.operators.looker.LookerStartPdtBuildOperator`. + +.. exampleinclude:: /../../airflow/providers/google/cloud/example_dags/example_looker.py + :language: python + :dedent: 4 + :start-after: [START how_to_cloud_looker_start_pdt_build_operator] + :end-before: [END how_to_cloud_looker_start_pdt_build_operator] + + +Alternatively, the job configuration can be submitted in asynchronous mode by using: +:class:`~airflow.providers.google.cloud.operators.looker.LookerStartPdtBuildOperator` and +:class:`~airflow.providers.google.cloud.sensors.looker.LookerCheckPdtBuildSensor`. + +.. exampleinclude:: /../../airflow/providers/google/cloud/example_dags/example_looker.py + :language: python + :dedent: 4 + :start-after: [START cloud_looker_async_start_pdt_sensor] + :end-before: [END cloud_looker_async_start_pdt_sensor] + +There are more arguments to provide in the jobs than the examples show. +For the complete list of arguments take a look at Looker operator arguments at +`GitHub <https://github.com/apache/airflow/blob/main/airflow/providers/google/cloud/operators/looker.py>`__ Review comment: We shouldn't refer to Github as we have generated reference documentation for each operator. https://airflow.apache.org/docs/apache-airflow-providers-google/stable/_api/airflow/providers/google/cloud/operators/vision/index.html#airflow.providers.google.cloud.operators.vision.CloudVisionGetProductSetOperator For example: To generate link to `airflow.providers.google.cloud.sensors.looker.LookerCheckPdtBuildSensor` class, you should. use the following syntax: ``` :class:`airflow.providers.google.cloud.sensors.looker.LookerCheckPdtBuildSensor` ``` Here is docs: https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#python-roles -- 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]
