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/15 12:57:59 UTC

[GitHub] [airflow] JavierLopezT opened a new pull request #13694: Add FTPToS3Operator

JavierLopezT opened a new pull request #13694:
URL: https://github.com/apache/airflow/pull/13694


   New transfer operator
   


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



[GitHub] [airflow] JavierLopezT closed pull request #13694: Add FTPToS3Operator (messed, closed)

Posted by GitBox <gi...@apache.org>.
JavierLopezT closed pull request #13694:
URL: https://github.com/apache/airflow/pull/13694


   


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



[GitHub] [airflow] github-actions[bot] commented on pull request #13694: Add FTPToS3Operator

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #13694:
URL: https://github.com/apache/airflow/pull/13694#issuecomment-761249078


   [The Workflow run](https://github.com/apache/airflow/actions/runs/489118206) is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.


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



[GitHub] [airflow] github-actions[bot] commented on pull request #13694: Add FTPToS3Operator

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #13694:
URL: https://github.com/apache/airflow/pull/13694#issuecomment-761024365


   [The Workflow run](https://github.com/apache/airflow/actions/runs/488131576) is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.


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



[GitHub] [airflow] subkanthi commented on a change in pull request #13694: Add FTPToS3Operator

Posted by GitBox <gi...@apache.org>.
subkanthi commented on a change in pull request #13694:
URL: https://github.com/apache/airflow/pull/13694#discussion_r558569158



##########
File path: tests/providers/amazon/aws/transfers/test_ftp_to_s3.py
##########
@@ -0,0 +1,44 @@
+#
+# 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.
+import unittest
+from unittest import mock
+
+from airflow.providers.amazon.aws.transfers.ftp_to_s3 import FTPToS3Operator
+
+TASK_ID = 'test_s3_to_ftp'
+BUCKET = 'test-s3-bucket'
+S3_KEY = 'test/test_1_file.csv'
+FTP_PATH = '/tmp/remote_path.txt'
+AWS_CONN_ID = 'aws_default'
+FTP_CONN_ID = 'ftp_default'
+
+
+class TestS3ToFTPOperator(unittest.TestCase):

Review comment:
       Is this a typo, it should be testing FTPToS3Operator right/

##########
File path: tests/providers/amazon/aws/transfers/test_ftp_to_s3.py
##########
@@ -0,0 +1,44 @@
+#
+# 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.
+import unittest
+from unittest import mock
+
+from airflow.providers.amazon.aws.transfers.ftp_to_s3 import FTPToS3Operator
+
+TASK_ID = 'test_s3_to_ftp'
+BUCKET = 'test-s3-bucket'
+S3_KEY = 'test/test_1_file.csv'
+FTP_PATH = '/tmp/remote_path.txt'
+AWS_CONN_ID = 'aws_default'
+FTP_CONN_ID = 'ftp_default'
+
+
+class TestS3ToFTPOperator(unittest.TestCase):
+    @mock.patch("airflow.providers.ftp.hooks.ftp.FTPHook.retrieve_file")
+    @mock.patch("airflow.providers.amazon.aws.hooks.s3.S3Hook.load_file")
+    @mock.patch("airflow.providers.amazon.aws.transfers.ftp_to_s3.NamedTemporaryFile")
+    def test_execute(self, mock_local_tmp_file, mock_s3_hook_load_file, mock_ftp_hook_retrieve_file):
+        operator = S3ToFTPOperator(task_id=TASK_ID, s3_bucket=BUCKET, s3_key=S3_KEY, ftp_path=FTP_PATH)

Review comment:
       same here?




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



[GitHub] [airflow] github-actions[bot] commented on pull request #13694: Add FTPToS3Operator

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #13694:
URL: https://github.com/apache/airflow/pull/13694#issuecomment-761249324


   [The Workflow run](https://github.com/apache/airflow/actions/runs/489068085) is cancelling this PR. Building image for the PR has been cancelled


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



[GitHub] [airflow] JavierLopezT commented on a change in pull request #13694: Add FTPToS3Operator

Posted by GitBox <gi...@apache.org>.
JavierLopezT commented on a change in pull request #13694:
URL: https://github.com/apache/airflow/pull/13694#discussion_r558595149



##########
File path: tests/providers/amazon/aws/transfers/test_ftp_to_s3.py
##########
@@ -0,0 +1,44 @@
+#
+# 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.
+import unittest
+from unittest import mock
+
+from airflow.providers.amazon.aws.transfers.ftp_to_s3 import FTPToS3Operator
+
+TASK_ID = 'test_s3_to_ftp'
+BUCKET = 'test-s3-bucket'
+S3_KEY = 'test/test_1_file.csv'
+FTP_PATH = '/tmp/remote_path.txt'
+AWS_CONN_ID = 'aws_default'
+FTP_CONN_ID = 'ftp_default'
+
+
+class TestS3ToFTPOperator(unittest.TestCase):
+    @mock.patch("airflow.providers.ftp.hooks.ftp.FTPHook.retrieve_file")
+    @mock.patch("airflow.providers.amazon.aws.hooks.s3.S3Hook.load_file")
+    @mock.patch("airflow.providers.amazon.aws.transfers.ftp_to_s3.NamedTemporaryFile")
+    def test_execute(self, mock_local_tmp_file, mock_s3_hook_load_file, mock_ftp_hook_retrieve_file):
+        operator = S3ToFTPOperator(task_id=TASK_ID, s3_bucket=BUCKET, s3_key=S3_KEY, ftp_path=FTP_PATH)

Review comment:
       Indeed. Thanks!




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