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(model, view, query_params=None)[source]

Submit 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]

Get 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]

Get the PDT materialization job status.

Parameters

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

stop_pdt_build(materialization_id)[source]

Start 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]

Poll 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]

Return 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]

Fetch the connection settings from Airflow’s connection object.

Overrides the default logic of getting connection settings.

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?