Airflow Summit 2025 is coming October 07-09. Register now for early bird ticket!

airflow.providers.teradata.hooks.ttu

Classes

TtuHook

Abstract base hook for integrating Teradata Tools and Utilities (TTU) in Airflow.

Module Contents

class airflow.providers.teradata.hooks.ttu.TtuHook(teradata_conn_id='teradata_default', *args, **kwargs)[source]

Bases: airflow.hooks.base.BaseHook, abc.ABC

Abstract base hook for integrating Teradata Tools and Utilities (TTU) in Airflow.

This hook provides common connection handling, resource management, and lifecycle support for TTU based operations such as BTEQ, TLOAD, and TPT.

It should not be used directly. Instead, it must be subclassed by concrete hooks like BteqHook, TloadHook, or TddlHook that implement the actual TTU command logic.

Core Features: - Establishes a reusable Teradata connection configuration. - Provides context management for safe resource cleanup. - Manages subprocess termination (e.g., for long-running TTU jobs).

Requirements: - TTU command-line tools must be installed and accessible via PATH. - A valid Airflow connection with Teradata credentials must be configured.

teradata_conn_id = 'teradata_default'[source]
conn: dict[str, Any] | None = None[source]
__enter__()[source]
__exit__(exc_type, exc_val, exc_tb)[source]
get_conn()[source]

Set up and return a Teradata connection dictionary.

This dictionary includes connection credentials and a subprocess placeholder. Ensures connection is created only once per hook instance.

Returns:

Dictionary with connection details.

Return type:

dict[str, Any]

close_conn()[source]

Terminate any active TTU subprocess and clear the connection.

Was this entry helpful?