Repository: apache/airflow
Pull request: add acl_policy to S3CopyObjectOperator
resolves https://github.com/apache/airflow/issues/13774

Problem statement:
add acl_policy to S3CopyObjectOperator
<!--

Welcome to Apache Airflow!  For a smooth issue process, try to answer the following questions.
Don't worry if they're not all applicable; just try to include what you can :-)

If you need to include code snippets or logs, please put them in fenced code
blocks.  If they're super-long, please use the details tag like
<details><summary>super-long log</summary> lots of stuff </details>

Please delete these comment blocks before submitting the issue.

-->

**Description**

<!-- A short description of your feature -->

**Use case / motivation**

<!-- What do you want to happen?

Rather than telling us how you might implement this solution, try to take a
step back and describe what you are trying to achieve.

-->

**Are you willing to submit a PR?**

<!--- We accept contributions! -->

**Related Issues**

<!-- Is there currently another issue associated with this? -->

Hints from issue discussion:

Commit message: add acl_policy to S3CopyObjectOperator

Patch to review:
diff --git a/airflow/providers/amazon/aws/operators/s3_copy_object.py b/airflow/providers/amazon/aws/operators/s3_copy_object.py
index 052c9adfb1b3f..841bf7feddbf2 100644
--- a/airflow/providers/amazon/aws/operators/s3_copy_object.py
+++ b/airflow/providers/amazon/aws/operators/s3_copy_object.py
@@ -63,6 +63,8 @@ class S3CopyObjectOperator(BaseOperator):
                  You can specify this argument if you want to use a different
                  CA cert bundle than the one used by botocore.
     :type verify: bool or str
+    :param acl_policy
+    :type acl_policy: str
     """
 
     template_fields = ('source_bucket_key', 'dest_bucket_key', 'source_bucket_name', 'dest_bucket_name')
@@ -78,6 +80,7 @@ def __init__(
         source_version_id: Optional[str] = None,
         aws_conn_id: str = 'aws_default',
         verify: Optional[Union[str, bool]] = None,
+        acl_policy: Optional[str] = None,
         **kwargs,
     ):
         super().__init__(**kwargs)
@@ -89,6 +92,7 @@ def __init__(
         self.source_version_id = source_version_id
         self.aws_conn_id = aws_conn_id
         self.verify = verify
+        self.acl_policy acl_policy
 
     def execute(self, context):
         s3_hook = S3Hook(aws_conn_id=self.aws_conn_id, verify=self.verify)
@@ -98,4 +102,5 @@ def execute(self, context):
             self.source_bucket_name,
             self.dest_bucket_name,
             self.source_version_id,
+            self.acl_policy,
         )


Code review comments:
diff_hunk: @@ -89,6 +92,7 @@ def __init__(
         self.source_version_id = source_version_id
         self.aws_conn_id = aws_conn_id
         self.verify = verify
+        self.acl_policy acl_policy
path: airflow/providers/amazon/aws/operators/s3_copy_object.py
text: @user1:
```suggestion
        self.acl_policy = acl_policy
```

diff_hunk: @@ -63,6 +63,8 @@ class S3CopyObjectOperator(BaseOperator):
                  You can specify this argument if you want to use a different
                  CA cert bundle than the one used by botocore.
     :type verify: bool or str
+    :param acl_policy
path: airflow/providers/amazon/aws/operators/s3_copy_object.py
text: @user1:
```suggestion
    :param acl_policy: String specifying the canned ACL policy for the file being
        uploaded to the S3 bucket.
```