airflow.providers.amazon.aws.hooks.redshift_sql

Module Contents

Classes

RedshiftSQLHook

Execute statements against Amazon Redshift, using redshift_connector

class airflow.providers.amazon.aws.hooks.redshift_sql.RedshiftSQLHook(*args, schema=None, log_sql=True, **kwargs)[source]

Bases: airflow.providers.common.sql.hooks.sql.DbApiHook

Execute statements against Amazon Redshift, using redshift_connector

This hook requires the redshift_conn_id connection.

Parameters

redshift_conn_id -- reference to Amazon Redshift connection id

Note

get_sqlalchemy_engine() and get_uri() depend on sqlalchemy-amazon-redshift

conn_name_attr = redshift_conn_id[source]
default_conn_name = redshift_default[source]
conn_type = redshift[source]
hook_name = Amazon Redshift[source]
supports_autocommit = True[source]
static get_ui_field_behavior()[source]

Returns custom field behavior

conn()[source]
get_uri()[source]

Overrides DbApiHook get_uri to use redshift_connector sqlalchemy dialect as driver name

get_sqlalchemy_engine(engine_kwargs=None)[source]

Overrides DbApiHook get_sqlalchemy_engine to pass redshift_connector specific kwargs

get_table_primary_key(table, schema='public')[source]

Helper method that returns the table primary key :param table: Name of the target table :param table: Name of the target schema, public by default :return: Primary key columns list :rtype: List[str]

get_conn()[source]

Returns a redshift_connector.Connection object

Was this entry helpful?