airflow.providers.google.cloud.hooks.looker

This module contains a Google Cloud Looker hook.

Module Contents

Classes

LookerHook

Hook for Looker APIs.

LookerApiSettings

Custom implementation of Looker SDK's ApiSettings class.

JobStatus

The job status string.

class airflow.providers.google.cloud.hooks.looker.LookerHook(looker_conn_id)[source]

Bases: airflow.hooks.base.BaseHook

Hook for Looker APIs.

start_pdt_build(self, 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 (Optional[Dict]) – Optional. Additional materialization parameters.

check_pdt_build(self, 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(self, materialization_id)[source]

Gets the PDT materialization job status.

Parameters

materialization_id (str) – Required. The materialization id to check status for.

stop_pdt_build(self, materialization_id)[source]

Starts a PDT materialization job cancellation request.

Parameters

materialization_id (str) – Required. The materialization id to stop.

wait_for_job(self, 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 (Optional[int]) – Optional. How many seconds wait for job to be ready. Used only if asynchronous is False.

get_looker_sdk(self)[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(self)[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]

Was this entry helpful?