o-nikolas commented on code in PR #60597:
URL: https://github.com/apache/airflow/pull/60597#discussion_r2775670436


##########
providers/amazon/src/airflow/providers/amazon/aws/hooks/s3.py:
##########
@@ -1426,6 +1432,14 @@ def copy_object(
         if self._requester_pays:
             kwargs["RequestPayer"] = "requester"
 
+        if (kms_key_id and not kms_encryption_type) or (kms_encryption_type 
and not kms_key_id):
+            message = "kms_key_id and kms_encryption_type must both be 
specified. Only one was provided."
+            self.log.error(message)
+            raise ValueError(message)

Review Comment:
   Nit: Is it helpful to double log the message here?



##########
providers/amazon/src/airflow/providers/amazon/aws/hooks/s3.py:
##########
@@ -1426,6 +1432,14 @@ def copy_object(
         if self._requester_pays:
             kwargs["RequestPayer"] = "requester"
 
+        if (kms_key_id and not kms_encryption_type) or (kms_encryption_type 
and not kms_key_id):

Review Comment:
   Nit: this might be slightly less cluttered:
   
   ```suggestion
           if bool(kms_key_id) != bool(kms_encryption_type):
   ```
   
   Basically we just care that they both resolve to the same "something", 
either a str value each (so truthy) or None (falsey)



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to