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 2019/01/11 13:44:22 UTC

[GitHub] Fokko commented on a change in pull request #4476: [AIRFLOW-3552] Add ImapToS3TransferOperator

Fokko commented on a change in pull request #4476: [AIRFLOW-3552] Add ImapToS3TransferOperator
URL: https://github.com/apache/airflow/pull/4476#discussion_r247118803
 
 

 ##########
 File path: airflow/contrib/operators/imap_to_s3_transfer_operator.py
 ##########
 @@ -0,0 +1,85 @@
+# -*- coding: utf-8 -*-
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+from airflow.contrib.hooks.imap_hook import ImapHook
+from airflow.hooks.S3_hook import S3Hook
+from airflow.models import BaseOperator
+
+
+class ImapToS3TransferOperator(BaseOperator):
+    """
+    Transfers a mail attachment from a mail server into s3 bucket.
+
+    :param imap_attachment_name: The file name of the mail attachment that you want to transfer.
+    :type imap_attachment_name: str
+    :param s3_key: The destination file name in the s3 bucket for the attachment.
+    :type s3_key: str
+    :param imap_mail_folder: The folder on the mail server to look for the attachment.
+    :type imap_mail_folder: str
+    :param imap_check_regex: If set checks the `imap_attachment_name` for a regular expression.
+    :type imap_check_regex: bool
+    :param s3_overwrite: If set overwrites the s3 key if already exists.
+    :type s3_overwrite: bool
+    :param imap_conn_id: The reference to the connection details of the mail server.
+    :type imap_conn_id: str
+    :param s3_conn_id: The reference to the s3 connection details.
+    :type s3_conn_id: str
+    """
+
+    def __init__(self,
 
 Review comment:
   Can you add `@apply_defaults`? https://github.com/apache/airflow/blob/master/airflow/operators/presto_check_operator.py#L60

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services