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 2021/01/04 19:36:30 UTC

[GitHub] [airflow] DreamPearl commented on a change in pull request #13187: [AIRFLOW-3723] Add Gzip capability to mongo_to_S3 operator

DreamPearl commented on a change in pull request #13187:
URL: https://github.com/apache/airflow/pull/13187#discussion_r551524557



##########
File path: airflow/providers/amazon/aws/hooks/s3.py
##########
@@ -539,11 +540,24 @@ def load_string(
         :param acl_policy: The string to specify the canned ACL policy for the
             object to be uploaded
         :type acl_policy: str
+        :param compression: Type of compression to use, currently only gzip is supported.
+        :type compression: str
         """
         encoding = encoding or 'utf-8'
 
         bytes_data = string_data.encode(encoding)
+
+        # Compress string
+        if compression not in (None, 'gzip'):
+            raise NotImplementedError(
+                "Received {} compression type. String "
+                "can currently be compressed in gzip only.".format(compression)
+            )

Review comment:
       Thanks for the suggestion, I've updated the PR. And also added one more test to check the exception raised. Can you please take a look again?




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

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