| :py:mod:`airflow.providers.amazon.aws.hooks.redshift_sql` |
| ========================================================= |
| |
| .. py:module:: airflow.providers.amazon.aws.hooks.redshift_sql |
| |
| |
| Module Contents |
| --------------- |
| |
| Classes |
| ~~~~~~~ |
| |
| .. autoapisummary:: |
| |
| airflow.providers.amazon.aws.hooks.redshift_sql.RedshiftSQLHook |
| |
| |
| |
| |
| .. py:class:: RedshiftSQLHook(*args, schema = None, **kwargs) |
| |
| Bases: :py:obj:`airflow.hooks.dbapi.DbApiHook` |
| |
| Execute statements against Amazon Redshift, using redshift_connector |
| |
| This hook requires the redshift_conn_id connection. |
| |
| :param redshift_conn_id: reference to |
| :ref:`Amazon Redshift connection id<howto/connection:redshift>` |
| |
| .. note:: |
| get_sqlalchemy_engine() and get_uri() depend on sqlalchemy-amazon-redshift |
| |
| .. py:attribute:: conn_name_attr |
| :annotation: = redshift_conn_id |
| |
| |
| |
| .. py:attribute:: default_conn_name |
| :annotation: = redshift_default |
| |
| |
| |
| .. py:attribute:: conn_type |
| :annotation: = redshift |
| |
| |
| |
| .. py:attribute:: hook_name |
| :annotation: = Amazon Redshift |
| |
| |
| |
| .. py:attribute:: supports_autocommit |
| :annotation: = True |
| |
| |
| |
| .. py:method:: get_ui_field_behavior() |
| :staticmethod: |
| |
| Returns custom field behavior |
| |
| |
| .. py:method:: conn(self) |
| |
| |
| .. py:method:: get_uri(self) |
| |
| Overrides DbApiHook get_uri to use redshift_connector sqlalchemy dialect as driver name |
| |
| |
| .. py:method:: get_sqlalchemy_engine(self, engine_kwargs=None) |
| |
| Overrides DbApiHook get_sqlalchemy_engine to pass redshift_connector specific kwargs |
| |
| |
| .. py:method:: get_table_primary_key(self, table, schema = 'public') |
| |
| 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] |
| |
| |
| .. py:method:: get_conn(self) |
| |
| Returns a redshift_connector.Connection object |
| |
| |
| |