RachitSharma2001 commented on code in PR #26974:
URL: https://github.com/apache/airflow/pull/26974#discussion_r1010684836


##########
airflow/providers/ftp/example_dags/example_ftp.py:
##########
@@ -0,0 +1,51 @@
+# 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 __future__ import annotations
+
+from datetime import datetime
+
+from airflow import models
+from airflow.providers.ftp.operators.ftp import FTPOperation, FTPOperator
+
+with models.DAG(
+    "example_ftp_put_get",
+    schedule_interval=None,
+    start_date=datetime(2021, 1, 1),
+    catchup=False,
+) as dag:
+    # [START howto_ftp_put]
+    ftp_put = FTPOperator(
+        task_id="test_ftp_put",
+        ftp_conn_id="ftp_default",
+        local_filepath="/tmp/filepath",

Review Comment:
   I see, so do you mean that rather than defining the FTP Operator within 
`airflow.providers.ftp.operators`, instead define them in a class within the 
`airflow.providers.ftp.transfers` folder? Looking through examples of operators 
defined in transfers folder, like for the microsoft azure transfer operators, 
it seems like many of them are unidirectional in the sense that they only 
upload files from local to a remote server, or only download files from a 
remote to a local. I was thinking that maybe it would make more sense to make 
FTPOperator a pure operator rather than a transfer operator since it can do 
bidirectional file movements and the direction is determined by passed-in 
parameters from the user, similar to how the SFTPOperator is defined  
[here](https://github.com/apache/airflow/tree/219df18414185e426aab9bb8f297785d6f54f6a5/airflow/providers/sftp/operators).



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to