awswrangler.redshift.connect

awswrangler.redshift.connect(connection: str, catalog_id: Optional[str] = None, boto3_session: Optional[boto3.session.Session] = None, ssl: bool = True, timeout: Optional[int] = None, max_prepared_statements: int = 1000, tcp_keepalive: bool = True) → redshift_connector.core.Connection

Return a redshift_connector connection from a Glue Catalog Connection.

https://github.com/aws/amazon-redshift-python-driver

Parameters
Returns

redshift_connector connection.

Return type

redshift_connector.Connection

Examples

>>> import awswrangler as wr
>>> con = wr.redshift.connect("MY_GLUE_CONNECTION")
>>> with con.cursor() as cursor:
>>>     cursor.execute("SELECT 1")
>>>     print(cursor.fetchall())
>>> con.close()