mik-laj commented on a change in pull request #6393: [AIRFLOW-5718] Add SFTPToGoogleCloudStorageOperator [depends on AIRFLOW-5717] URL: https://github.com/apache/airflow/pull/6393#discussion_r339004687
########## File path: airflow/operators/sftp_to_gcs.py ########## @@ -0,0 +1,219 @@ +# +# 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. +""" +This module contains SFTP to Google Cloud Storage operator. +""" +import os +from tempfile import NamedTemporaryFile +from typing import Optional, Union + +from airflow import AirflowException +from airflow.contrib.hooks.sftp_hook import SFTPHook +from airflow.gcp.hooks.gcs import GoogleCloudStorageHook +from airflow.models import BaseOperator +from airflow.utils.decorators import apply_defaults + +WILDCARD = "*" + + +class SFTPToGoogleCloudStorageOperator(BaseOperator): + """ + Transfer files to Google Cloud Storage from SFTP server. + + .. seealso:: + For more information on how to use this operator, take a look at the guide: + :ref:`howto/operator:SFTPToGoogleCloudStorageOperator` + + :param source_path: The sftp remote path. This is the specified file path + for downloading the single file or multiple files from the SFTP server. + You can use only one wildcard within your path. The wildcard can appear + inside the path or at the end of the path. + :type source_path: str + :param destination_bucket: The bucket to upload to. + :type destination_bucket: str + :param destination_path: The destination name of the object in the + destination Google cloud storage bucket. Review comment: ```suggestion destination Google Cloud Storage bucket. ``` ---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services
