blob: be3fe07d4778d48d3ff69500eb766970753f4797 [file] [log] [blame]
:py:mod:`airflow.providers.google.cloud.hooks.looker`
=====================================================
.. py:module:: airflow.providers.google.cloud.hooks.looker
.. autoapi-nested-parse::
This module contains a Google Cloud Looker hook.
Module Contents
---------------
Classes
~~~~~~~
.. autoapisummary::
airflow.providers.google.cloud.hooks.looker.LookerHook
airflow.providers.google.cloud.hooks.looker.LookerApiSettings
airflow.providers.google.cloud.hooks.looker.JobStatus
.. py:class:: LookerHook(looker_conn_id)
Bases: :py:obj:`airflow.hooks.base.BaseHook`
Hook for Looker APIs.
.. py:method:: start_pdt_build(self, model, view, query_params = None)
Submits a PDT materialization job to Looker.
:param model: Required. The model of the PDT to start building.
:param view: Required. The view of the PDT to start building.
:param query_params: Optional. Additional materialization parameters.
.. py:method:: check_pdt_build(self, materialization_id)
Gets the PDT materialization job status from Looker.
:param materialization_id: Required. The materialization id to check status for.
.. py:method:: pdt_build_status(self, materialization_id)
Gets the PDT materialization job status.
:param materialization_id: Required. The materialization id to check status for.
.. py:method:: stop_pdt_build(self, materialization_id)
Starts a PDT materialization job cancellation request.
:param materialization_id: Required. The materialization id to stop.
.. py:method:: wait_for_job(self, materialization_id, wait_time = 10, timeout = None)
Helper method which polls a PDT materialization job to check if it finishes.
:param materialization_id: Required. The materialization id to wait for.
:param wait_time: Optional. Number of seconds between checks.
:param timeout: Optional. How many seconds wait for job to be ready.
Used only if ``asynchronous`` is False.
.. py:method:: get_looker_sdk(self)
Returns Looker SDK client for Looker API 4.0.
.. py:class:: LookerApiSettings(conn)
Bases: :py:obj:`looker_sdk.rtl.api_settings.ApiSettings`
Custom implementation of Looker SDK's `ApiSettings` class.
.. py:method:: read_config(self)
Overrides the default logic of getting connection settings. Fetches
the connection settings from Airflow's connection object.
.. py:class:: JobStatus
Bases: :py:obj:`enum.Enum`
The job status string.
.. py:attribute:: QUEUED
:annotation: = added
.. py:attribute:: PENDING
:annotation: = pending
.. py:attribute:: RUNNING
:annotation: = running
.. py:attribute:: CANCELLED
:annotation: = killed
.. py:attribute:: DONE
:annotation: = complete
.. py:attribute:: ERROR
:annotation: = error
.. py:attribute:: UNKNOWN
:annotation: = unknown