airflow.hooks.base_hook

Base class for all hooks

Module Contents

airflow.hooks.base_hook.CONN_ENV_PREFIX = AIRFLOW_CONN_[source]
class airflow.hooks.base_hook.BaseHook(source)[source]

Bases: airflow.utils.log.logging_mixin.LoggingMixin

Abstract base class for hooks, hooks are meant as an interface to interact with external systems. MySqlHook, HiveHook, PigHook return object that can handle the connection and interaction to specific instances of these systems, and expose consistent methods to interact with them.

classmethod _get_connections_from_db(cls, conn_id, session=None)[source]
classmethod _get_connection_from_env(cls, conn_id)[source]
classmethod get_connections(cls, conn_id)[source]

Get all connections as an iterable.

Parameters

conn_id – connection id

Returns

array of connections

classmethod get_connection(cls, conn_id)[source]
classmethod get_hook(cls, conn_id)[source]
get_conn(self)[source]
get_records(self, sql)[source]
get_pandas_df(self, sql)[source]
run(self, sql)[source]

Was this entry helpful?