astronomer.providers.amazon.aws.operators.redshift_data

Module Contents

Classes

RedshiftDataOperatorAsync

Executes SQL Statements against an Amazon Redshift cluster.

class astronomer.providers.amazon.aws.operators.redshift_data.RedshiftDataOperatorAsync(*, poll_interval=5, **kwargs)[source]

Bases: airflow.providers.amazon.aws.operators.redshift_data.RedshiftDataOperator

Executes SQL Statements against an Amazon Redshift cluster. If there are multiple queries as part of the SQL, and one of them fails to reach a successful completion state, the operator returns the relevant error for the failed query.

Parameters:
  • sql – the SQL code to be executed as a single string, or a list of str (sql statements), or a reference to a template file. Template references are recognized by str ending in ‘.sql’

  • aws_conn_id – AWS connection ID

  • parameters – (optional) the parameters to render the SQL query with.

  • autocommit – if True, each command is automatically committed. (default value: False)

execute(context)[source]

Makes a sync call to RedshiftDataHook, executes the query and gets back the list of query_ids and defers trigger to poll for the status for the queries executed.

execute_complete(context, event=None)[source]

Callback for when the trigger fires - returns immediately. Relies on trigger to throw an exception, otherwise it assumes execution was successful.