airflow.providers.amazon.aws.utils.mixins

This module contains different mixin classes for internal use within the Amazon provider.

Warning

Only for internal usage, this module and all classes might be changed, renamed or removed in the future without any further notice.

meta:

private

Attributes

AwsHookType

Classes

AwsHookParams

Default Aws Hook Parameters storage class.

AwsBaseHookMixin

Mixin class for AWS Operators, Sensors, etc.

Functions

aws_template_fields(*template_fields)

Merge provided template_fields with generic one and return in alphabetical order.

Module Contents

airflow.providers.amazon.aws.utils.mixins.AwsHookType[source]
class airflow.providers.amazon.aws.utils.mixins.AwsHookParams[source]

Bases: NamedTuple

Default Aws Hook Parameters storage class.

aws_conn_id: str | None[source]
region_name: str | None[source]
verify: bool | str | None[source]
botocore_config: dict[str, Any] | None[source]
classmethod from_constructor(aws_conn_id, region_name, verify, botocore_config, additional_params)[source]

Resolve generic AWS Hooks parameters in class constructor.

Examples:
class AwsFooBarOperator(BaseOperator):
    def __init__(
        self,
        *,
        aws_conn_id: str | None = "aws_default",
        region_name: str | None = None,
        verify: bool | str | None = None,
        botocore_config: dict | None = None,
        foo: str = "bar",
        **kwargs,
    ):
        params = AwsHookParams.from_constructor(
            aws_conn_id, region_name, verify, botocore_config, additional_params=kwargs
        )
        super().__init__(**kwargs)
        self.aws_conn_id = params.aws_conn_id
        self.region_name = params.region_name
        self.verify = params.verify
        self.botocore_config = params.botocore_config
        self.foo = foo
class airflow.providers.amazon.aws.utils.mixins.AwsBaseHookMixin[source]

Bases: Generic[AwsHookType]

Mixin class for AWS Operators, Sensors, etc.

Warning

Only for internal usage, this class might be changed, renamed or removed in the future without any further notice.

aws_hook_class: type[AwsHookType][source]
aws_conn_id: str | None[source]
region_name: str | None[source]
verify: bool | str | None[source]
botocore_config: dict[str, Any] | None[source]
validate_attributes()[source]

Validate class attributes.

property hook: AwsHookType[source]

Return AWS Provider’s hook based on aws_hook_class.

This method implementation should be taken as a final for thin-wrapped Hooks around boto3. For thick-wrapped Hooks developer should consider to overwrite _hook_parameters method instead.

airflow.providers.amazon.aws.utils.mixins.aws_template_fields(*template_fields)[source]

Merge provided template_fields with generic one and return in alphabetical order.

Was this entry helpful?