From 206e884512871118b4047c0e5292ff73985ecd86 Mon Sep 17 00:00:00 2001 From: Eugene Karimov Date: Mon, 27 Jun 2022 10:31:07 +0200 Subject: [PATCH] Minor fixes in RDS Create-Delete operators and DMS example DAG --- .../amazon/aws/example_dags/example_dms.py | 24 +++++++++---------- airflow/providers/amazon/aws/operators/rds.py | 10 ++++---- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/airflow/providers/amazon/aws/example_dags/example_dms.py b/airflow/providers/amazon/aws/example_dags/example_dms.py index d897a44b2544f..46e97d92a50d1 100644 --- a/airflow/providers/amazon/aws/example_dags/example_dms.py +++ b/airflow/providers/amazon/aws/example_dags/example_dms.py @@ -319,16 +319,16 @@ def delete_dms_assets(): ) chain( - create_db_instance - >> create_sample_table() - >> create_dms_assets() - >> create_task - >> start_task - >> describe_tasks - >> await_task_start - >> stop_task - >> await_task_stop - >> delete_task - >> delete_dms_assets() - >> delete_db_instance + create_db_instance, + create_sample_table(), + create_dms_assets(), + create_task, + start_task, + describe_tasks, + await_task_start, + stop_task, + await_task_stop, + delete_task, + delete_dms_assets(), + delete_db_instance, ) diff --git a/airflow/providers/amazon/aws/operators/rds.py b/airflow/providers/amazon/aws/operators/rds.py index e4fbfbe161760..fe38bfed69548 100644 --- a/airflow/providers/amazon/aws/operators/rds.py +++ b/airflow/providers/amazon/aws/operators/rds.py @@ -566,7 +566,8 @@ class RdsCreateDbInstanceOperator(RdsBaseOperator): :param rds_kwargs: Named arguments to pass to boto3 RDS client function ``create_db_instance`` https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/rds.html#RDS.Client.create_db_instance :param aws_conn_id: The Airflow connection used for AWS credentials. - :param wait_for_completion: Whether or not wait for creation of the DB instance complete. (default: True) + :param wait_for_completion: Whether or not wait for creation of the DB instance to + complete. (default: True) """ def __init__( @@ -589,7 +590,7 @@ def __init__( self.wait_for_completion = wait_for_completion def execute(self, context: 'Context') -> str: - self.log.info(f"Creating new DB instance {self.db_instance_identifier}") + self.log.info("Creating new DB instance %s", self.db_instance_identifier) create_db_instance = self.hook.conn.create_db_instance( DBInstanceIdentifier=self.db_instance_identifier, @@ -618,7 +619,8 @@ class RdsDeleteDbInstanceOperator(RdsBaseOperator): :param rds_kwargs: Named arguments to pass to boto3 RDS client function ``delete_db_instance`` https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/rds.html#RDS.Client.delete_db_instance :param aws_conn_id: The Airflow connection used for AWS credentials. - :param wait_for_completion: Whether or not wait for deletion of the DB instance complete. (default: True) + :param wait_for_completion: Whether or not wait for deletion of the DB instance to + complete. (default: True) """ def __init__( @@ -636,7 +638,7 @@ def __init__( self.wait_for_completion = wait_for_completion def execute(self, context: 'Context') -> str: - self.log.info(f"Deleting DB instance {self.db_instance_identifier}") + self.log.info("Deleting DB instance %s", self.db_instance_identifier) delete_db_instance = self.hook.conn.delete_db_instance( DBInstanceIdentifier=self.db_instance_identifier,