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