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 2022/08/19 19:41:43 UTC

[GitHub] [airflow] Taragolis commented on a diff in pull request #25835: Use the extra_args in get_key()

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


##########
airflow/providers/amazon/aws/hooks/s3.py:
##########
@@ -469,7 +469,7 @@ def get_key(self, key: str, bucket_name: Optional[str] = None) -> S3Transfer:
             verify=self.verify,
         )
         obj = s3_resource.Object(bucket_name, key)
-        obj.load()
+        obj.load(**self.extra_args)

Review Comment:
   Are you sure that you could provide anything to [S3.Object.load()](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html#S3.Object.load) method?
   
   Also please have a look [this](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/customizations/s3.html#s3-transfers). `extra_args` expected only use in this s3 client methods
   
   - [S3.Client.download_file()](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html#S3.Client.download_file)
   - [S3.Client.download_fileobj()](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html#S3.Client.download_fileobj)
   - [S3.Client.upload_file()](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html#S3.Client.upload_file)
   - [S3.Client.upload_fileobj()](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html#S3.Client.upload_fileobj)
   
   And I do not sure `extra_args` values fully compatible with `obj.load()`.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org