You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2018/08/30 12:18:38 UTC

[GitHub] ashb commented on a change in pull request #3823: [AIRFLOW-2985] An operator for S3 object copying

ashb commented on a change in pull request #3823: [AIRFLOW-2985] An operator for S3 object copying
URL: https://github.com/apache/incubator-airflow/pull/3823#discussion_r214007593
 
 

 ##########
 File path: airflow/contrib/operators/s3_copy_object_operator.py
 ##########
 @@ -0,0 +1,84 @@
+# -*- coding: utf-8 -*-
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+from pprint import pformat
+
+from airflow.hooks.S3_hook import S3Hook
+from airflow.models import BaseOperator
+from airflow.utils.decorators import apply_defaults
+
+
+class S3CopyObjectOperator(BaseOperator):
+    """
+    Creates a copy of an object that is already stored in S3.
+
+    :param dest_s3_bucket: The name of the bucket to copy to
+    :type dest_s3_bucket: str
+    :param dest_s3_key: The name of the key to copy to
+    :type dest_s3_key: str
+    :param source_s3_bucket: The name of the source bucket
+    :type source_s3_bucket: str
+    :param source_s3_key: Key name of the source object
+    :type source_s3_key: str
+    :param source_s3_version_id: Version ID of the source object (OPTIONAL)
+    :type source_s3_version_id: str
+    :param s3_conn_id: Connection id of the S3 connection to use
+    :type s3_conn_id: str
+    :parame verify: Whether or not to verify SSL certificates for S3 connetion.
+        By default SSL certificates are verified.
+        You can provide the following values:
+        - False: do not validate SSL certificates. SSL will still be used,
+                 but SSL certificates will not be
+                 verified.
+        - path/to/cert/bundle.pem: A filename of the CA cert bundle to uses.
+                 You can specify this argument if you want to use a different
+                 CA cert bundle than the one used by botocore.
+        This is also applicable to ``dest_verify``.
+    :type verify: bool or str
+    """
+
+    @apply_defaults
+    def __init__(
+            self,
+            dest_s3_bucket,
+            dest_s3_key,
+            source_s3_bucket,
 
 Review comment:
   It would be nice to support a single `s3://bucket/key` style parameter here like we do in the other S3 ops/sensors https://github.com/apache/incubator-airflow/blob/ac9033db0981ae1f770a8bdb5597055751ab15bd/airflow/sensors/s3_key_sensor.py#L34-L39

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services