vincbeck commented on code in PR #33031:
URL: https://github.com/apache/airflow/pull/33031#discussion_r1335924314


##########
airflow/providers/amazon/aws/transfers/gcs_to_s3.py:
##########
@@ -117,7 +119,18 @@ def __init__(
     ) -> None:
         super().__init__(**kwargs)
 
-        self.bucket = bucket
+        if bucket:
+            warnings.warn(
+                "The 'bucket' parameter is deprecated and will be removed in a 
future version. "
+                "Please use 'gcs_bucket' instead.",

Review Comment:
   ```suggestion
                   "The ``bucket`` parameter is deprecated and will be removed 
in a future version. "
                   "Please use ``gcs_bucket`` instead.",
   ```



##########
airflow/providers/amazon/aws/transfers/gcs_to_s3.py:
##########
@@ -117,7 +119,18 @@ def __init__(
     ) -> None:
         super().__init__(**kwargs)
 
-        self.bucket = bucket
+        if bucket:
+            warnings.warn(
+                "The 'bucket' parameter is deprecated and will be removed in a 
future version. "
+                "Please use 'gcs_bucket' instead.",
+                AirflowProviderDeprecationWarning,
+                stacklevel=2,
+            )
+            self.gcs_bucket = bucket
+        elif gcs_bucket:
+            self.gcs_bucket = gcs_bucket
+        else:
+            raise ValueError("You must pass either bucket or gcs_bucket.")

Review Comment:
   ```suggestion
               raise ValueError("You must pass either ``bucket`` or 
``gcs_bucket``.")
   ```



##########
airflow/providers/amazon/aws/transfers/gcs_to_s3.py:
##########
@@ -117,7 +119,18 @@ def __init__(
     ) -> None:
         super().__init__(**kwargs)
 
-        self.bucket = bucket
+        if bucket:
+            warnings.warn(
+                "The 'bucket' parameter is deprecated and will be removed in a 
future version. "
+                "Please use 'gcs_bucket' instead.",
+                AirflowProviderDeprecationWarning,
+                stacklevel=2,
+            )
+            self.gcs_bucket = bucket
+        elif gcs_bucket:

Review Comment:
   By just doing a if, if both are provided, we use `gcs_bucket`, which is what 
we want
   
   ```suggestion
           if gcs_bucket:
   ```



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