airflow.providers.teradata.hooks.teradata¶
An Airflow Hook for interacting with Teradata SQL Server.
Attributes¶
Classes¶
General hook for interacting with Teradata SQL Database. |
Module Contents¶
- class airflow.providers.teradata.hooks.teradata.TeradataHook(*args, database=None, **kwargs)[source]¶
Bases:
airflow.providers.common.sql.hooks.sql.DbApiHook
General hook for interacting with Teradata SQL Database.
This module contains basic APIs to connect to and interact with Teradata SQL Database. It uses teradatasql client internally as a database driver for connecting to Teradata database. The config parameters like Teradata DB Server URL, username, password and database name are fetched from the predefined connection config connection_id. It raises an airflow error if the given connection id doesn’t exist.
You can also specify ssl parameters in the extra field of your connection as
{"sslmode": "require", "sslcert": "/path/to/cert.pem", etc}
.See also
- Parameters:
args – passed to DbApiHook
database (str | None) – The Teradata database to connect to.
kwargs – passed to DbApiHook
- get_conn()[source]¶
Create and return a Teradata Connection object using teradatasql client.
Establishes connection to a Teradata SQL database using config corresponding to teradata_conn_id.
- Returns:
a Teradata connection object
- Return type:
teradatasql.TeradataConnection
- set_query_band(query_band_text, teradata_conn)[source]¶
Set SESSION Query Band for each connection session.
- callproc(identifier, autocommit=False, parameters=None)[source]¶
Call the stored procedure identified by the provided string.
Any OUT parameters must be provided with a value of either the expected Python type (e.g., int) or an instance of that type.
- Parameters:
The return value is a list or mapping that includes parameters in both directions; the actual return type depends on the type of the provided parameters argument.