potix2 commented on a change in pull request #11531:
URL: https://github.com/apache/airflow/pull/11531#discussion_r505808378
##########
File path: airflow/providers/amazon/aws/operators/datasync.py
##########
@@ -342,26 +356,27 @@ def _execute_datasync_task(self):
if not result:
raise AirflowException("Failed TaskExecutionArn %s" %
self.task_execution_arn)
- return self.task_execution_arn
Review comment:
This one is also.
##########
File path: airflow/providers/amazon/aws/operators/datasync.py
##########
@@ -342,26 +356,27 @@ def _execute_datasync_task(self):
if not result:
raise AirflowException("Failed TaskExecutionArn %s" %
self.task_execution_arn)
- return self.task_execution_arn
- def on_kill(self):
+ def on_kill(self) -> None:
"""Cancel the submitted DataSync task."""
hook = self.get_hook()
if self.task_execution_arn:
self.log.info("Cancelling TaskExecutionArn %s",
self.task_execution_arn)
hook.cancel_task_execution(task_execution_arn=self.task_execution_arn)
self.log.info("Cancelled TaskExecutionArn %s",
self.task_execution_arn)
- def _delete_datasync_task(self):
+ def _delete_datasync_task(self) -> None:
"""Deletes an AWS DataSync Task."""
+ if not self.task_arn:
+ return
+
hook = self.get_hook()
# Delete task:
self.log.info("Deleting Task with TaskArn %s", self.task_arn)
hook.delete_task(self.task_arn)
self.log.info("Task Deleted")
- return self.task_arn
Review comment:
This one is also.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]