awswrangler.data_api.redshift.RedshiftDataApi

class awswrangler.data_api.redshift.RedshiftDataApi(cluster_id: str, database: str, secret_arn: str = '', db_user: str = '', sleep: float = 0.25, backoff: float = 1.5, retries: int = 15, boto3_session: Optional[Session] = None)

Provides access to a Redshift cluster via the Data API.

Parameters
  • cluster_id (str) – Id for the target Redshift cluster.

  • database (str) – Target database name.

  • secret_arn (str) – The ARN for the secret to be used for authentication - only required if db_user not provided.

  • db_user (str) – The database user to generate temporary credentials for - only required if secret_arn not provided.

  • sleep (float) – Number of seconds to sleep between result fetch attempts - defaults to 0.25.

  • backoff (float) – Factor by which to increase the sleep between result fetch attempts - defaults to 1.5.

  • retries (int) – Maximum number of result fetch attempts - defaults to 15.

  • boto3_session (boto3.Session(), optional) – The boto3 session. If None, the default boto3 session is used.

__init__(cluster_id: str, database: str, secret_arn: str = '', db_user: str = '', sleep: float = 0.25, backoff: float = 1.5, retries: int = 15, boto3_session: Optional[Session] = None) None

Methods

__init__(cluster_id, database[, secret_arn, ...])

execute(sql[, database])

Execute SQL statement against a Data API Service.