airflow.providers.amazon.aws.hooks.quicksight

Classes

QuickSightHook

Interact with Amazon QuickSight.

Module Contents

class airflow.providers.amazon.aws.hooks.quicksight.QuickSightHook(*args, **kwargs)[source]

Bases: airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook

Interact with Amazon QuickSight.

Provide thin wrapper around boto3.client("quicksight").

Additional arguments (such as aws_conn_id) may be specified and are passed down to the underlying AwsBaseHook.

NON_TERMINAL_STATES[source]
FAILED_STATES[source]
create_ingestion(data_set_id, ingestion_id, ingestion_type, wait_for_completion=True, check_interval=30, aws_account_id=None, waiter_max_attempts=4320)[source]

Create and start a new SPICE ingestion for a dataset; refresh the SPICE datasets.

Parameters:
  • data_set_id (str) – ID of the dataset used in the ingestion.

  • ingestion_id (str) – ID for the ingestion.

  • ingestion_type (str) – Type of ingestion: “INCREMENTAL_REFRESH”|”FULL_REFRESH”

  • wait_for_completion (bool) – if the program should keep running until job finishes

  • check_interval (int) – the time interval in seconds which the operator will check the status of QuickSight Ingestion

  • aws_account_id (str | None) – An AWS Account ID, if set to None then use associated AWS Account ID.

  • waiter_max_attempts (int) – The maximum number of attempts to be made.

Returns:

Returns descriptive information about the created data ingestion having Ingestion ARN, HTTP status, ingestion ID and ingestion status.

Return type:

dict

wait_for_ingestion(*, data_set_id, ingestion_id, aws_account_id=None, waiter_delay=30, waiter_max_attempts=4320)[source]

Poll a SPICE ingestion until it completes.

Parameters:
  • data_set_id (str) – QuickSight Data Set ID

  • ingestion_id (str) – QuickSight Ingestion ID

  • aws_account_id (str | None) – An AWS Account ID, if set to None then use associated AWS Account ID.

  • waiter_delay (int) – The amount of time in seconds to wait between attempts.

  • waiter_max_attempts (int) – The maximum number of attempts to be made.

Raises:

RuntimeError – If the ingestion fails, is cancelled or times out.

get_status(aws_account_id, data_set_id, ingestion_id)[source]

Get the current status of QuickSight Create Ingestion API.

Parameters:
  • aws_account_id (str | None) – An AWS Account ID, if set to None then use associated AWS Account ID.

  • data_set_id (str) – QuickSight Data Set ID

  • ingestion_id (str) – QuickSight Ingestion ID

Returns:

An QuickSight Ingestion Status

Return type:

str

get_error_info(aws_account_id, data_set_id, ingestion_id)[source]

Get info about the error if any.

Parameters:
  • aws_account_id (str | None) – An AWS Account ID, if set to None then use associated AWS Account ID.

  • data_set_id (str) – QuickSight Data Set ID

  • ingestion_id (str) – QuickSight Ingestion ID

Returns:

Error info dict containing the error type (key ‘Type’) and message (key ‘Message’) if available. Else, returns None.

Return type:

dict | None

wait_for_state(aws_account_id, data_set_id, ingestion_id, target_state, check_interval)[source]

Check status of a QuickSight Create Ingestion API.

Deprecated since version Use: wait_for_ingestion() instead.

Parameters:
  • aws_account_id (str | None) – An AWS Account ID, if set to None then use associated AWS Account ID.

  • data_set_id (str) – QuickSight Data Set ID

  • ingestion_id (str) – QuickSight Ingestion ID

  • target_state (set) – Describes the QuickSight Job’s Target State

  • check_interval (int) – the time interval in seconds which the operator will check the status of QuickSight Ingestion

Returns:

the final status of the ingestion

Was this entry helpful?