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 09:14:19 UTC

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

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



##########
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:
       Maybe we could automatically create the error message based on available compressions if we store these in a variable and read from it.




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