Taragolis commented on code in PR #37886:
URL: https://github.com/apache/airflow/pull/37886#discussion_r1511795036


##########
airflow/providers/amazon/aws/hooks/s3.py:
##########
@@ -1390,6 +1379,12 @@ def download_file(
             Default: True.
         :return: the file name.
         """
+        self.log.info(
+            "This function shadows the 'download_file' method of S3 API, but 
it is not the same. If you "
+            "want to use the original method from S3 API, please call "
+            "'S3Hook.get_conn().download_file()'"
+        )
+

Review Comment:
   ```suggestion
           self.log.info(
               "This function shadows the 'download_file' method of S3 API, but 
it is not the same. If you "
               "want to use the original method from S3 API, please call "
               "'S3Hook.get_conn().download_file()'"
           )
   
   ```
   
   https://github.com/apache/airflow/pull/37211



##########
airflow/providers/amazon/aws/hooks/s3.py:
##########
@@ -1369,10 +1362,6 @@ def download_file(
         """
         Download a file from the S3 location to the local file system.
 
-        Note:
-            This function shadows the 'download_file' method of S3 API, but it 
is not the same.
-            If you want to use the original method from S3 API, please use 
'S3Hook.get_conn().download_file()'
-

Review Comment:
   Seems like you do not rebase on current main, this changes made by previous 
PR



##########
airflow/providers/amazon/aws/hooks/s3.py:
##########
@@ -188,6 +185,15 @@ def __init__(
 
         super().__init__(*args, **kwargs)
 
+    @cached_property
+    def resource(self):
+        return self.get_session().resource(
+            "s3",
+            endpoint_url=self.conn_config.endpoint_url,

Review Comment:
   ```suggestion
               
endpoint_url=self.conn_config.get_service_endpoint_url(service_name=service_name)
   ```



##########
airflow/providers/amazon/aws/hooks/s3.py:
##########
@@ -55,22 +57,17 @@
 from airflow.providers.amazon.aws.utils.tags import format_tags
 from airflow.utils.helpers import chunks
 
-if TYPE_CHECKING:
-    from mypy_boto3_s3.service_resource import Bucket as S3Bucket, Object as 
S3ResourceObject
-
-T = TypeVar("T", bound=Callable)
-
 logger = logging.getLogger(__name__)
 
 
-def provide_bucket_name(func: T) -> T:
+def provide_bucket_name(func: Callable) -> Callable:

Review Comment:
   Is this change relate to this PR?



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