potiuk commented on a change in pull request #6773: [AIRFLOW-6038] AWS DataSync 
example_dags added
URL: https://github.com/apache/airflow/pull/6773#discussion_r356560360
 
 

 ##########
 File path: airflow/providers/amazon/aws/operators/datasync.py
 ##########
 @@ -27,25 +25,45 @@
 from airflow.utils.decorators import apply_defaults
 
 
-class AWSDataSyncCreateTaskOperator(BaseOperator):
-    r"""Create an AWS DataSync Task.
+# pylint: disable=too-many-instance-attributes, too-many-arguments
+class AWSDataSyncOperator(BaseOperator):
+    r"""Find, Create, Update, Execute and Delete AWS DataSync Tasks.
+
+    If ``do_xcom_push`` is True, then the TaskArn and TaskExecutionArn which
+    were executed will be pushed to an XCom.
 
-    If there are existing Locations which match the specified
-    source and destination URIs then these will be used for the Task.
-    Otherwise, new Locations can be created automatically,
-    depending on input parameters.
+    .. seealso::
+        For more information on how to use this operator, take a look at the 
guide:
+        :ref:`howto/operator:AWSDataSyncOperator`
 
-    If ``do_xcom_push`` is True, the TaskArn which is created
-    will be pushed to an XCom.
+    .. note:: There may be 0, 1, or many existing DataSync Tasks. The default
+        behavior is to create a new Task if there are 0, or execute the Task
+        if there was 1 Task, or fail if there were many Tasks.
 
     :param str aws_conn_id: AWS connection to use.
-    :param str source_location_uri: Source location URI.
+    :param int wait_for_task_execution: Time to wait between two
+        consecutive calls to check TaskExecution status.
+    :param str task_arn: AWS DataSync TaskArn to use. If None, then this 
operator will
+        attempt to either search for an existing Task or create a new Task.
+    :param str source_location_uri: Source location URI to search for. All 
DataSync
+        Tasks with a LocationArn with this URI will be considered.
         Example: ``smb://server/subdir``
-    :param str destination_location_uri: Destination location URI.
+    :param str destination_location_uri: Destination location URI to search 
for.
+        All DataSync Tasks with a LocationArn with this URI will be considered.
         Example: ``s3://airflow_bucket/stuff``
-    :param bool case_sensitive_location_search: Whether or not to do a
+    :param bool location_search_case_sensitive: Whether or not to do a
 
 Review comment:
   I think we have a bit too many parameters here. Are we sure you want to 
leave it up to the user? I am not sure how resource definitions look like in 
AWS and whether they can be case-sensitive, but maybe (it's just suggestion) to 
make it more opinionated and do always case insensitive, trailing slash 
ignoring match ?  It would just make less variations to test.

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to